我想从只读文本框中获取价值,我试图通过#include <iostream>
#include <math.h>
#include <cmath>
#include <iomanip>
using namespace std;
int main()
{
double third = 1./3.;
cout << "1./3. Precision test" << endl;
cout << setw(7) << "1./3.: " << setprecision(20) << third << endl;
cout << " ";
for (int i = 1; i <= 20; i++) {
third *= 10;
if (int(third) == 3)
cout << " ";
else
cout << "^";
while (third >= 1) third -= 1;
}
cout << endl;
// For debugging purposes
third = 1./3.;
cout << " ";
for (int i = 1; i <= 20; i++) {
third *= 10;
cout << int(third);
while (third > 1) third -= 1;
}
cout << endl;
}
获取它,但它返回getAttribute
。
这是HTML代码:
null
这是我使用的脚本:
<input name="ctl00$ContentPlaceHolder1$txtStreetNumber" type="text" id="ctl00_ContentPlaceHolder1_txtStreetNumber" class="inputtxtreadonly" style="width:168px;" originalvalue="" disabled="enable" readonly="readonly">
答案 0 :(得分:0)
您可以使用getText()方法获取disable元素的值。