mshtml.IHTMLDocument2 doc2 = (mshtml.IHTMLDocument2)Browser.Document;
mshtml.IHTMLElementCollection inputs = (mshtml.IHTMLElementCollection)doc2.all.tags("INPUT");
mshtml.HTMLInputElement input1 = (mshtml.HTMLInputElement)inputs.item("sfzmhm", 1);
//input1.readOnly = true;
//MessageBox.Show(input1.value);
mshtml.HTMLInputElement input2 = (mshtml.HTMLInputElement)inputs.item("syr", 0);
input2.value = "刘德华";
mshtml.IHTMLElement element2 = (mshtml.IHTMLElement)inputs.item("buttonOK", 0);
//不可用
//element2.outerHTML = "<input id="buttonOK" name="buttonOK" disabled="disabled" type="button" class="button" value="确定(F8)" onclick="formsubmit();">";
//可用
element2.outerHTML = "<input id="buttonOK" name="buttonOK" type="button" class="button" value="确定(F8)" onclick="formsubmit();">";
Chrome测试你的代码 是 OK的
?????我这段代码都是报错的状态呀,请问怎么改的啊
document.getElementByIdx("buttonOK").disabled=true;
$(’#buttonOK’).attr(‘disabled’, true);
用jQuery啊,方便,直接将上面的脚本输出到HTML即可。。。
buttonName . active 填 true 或者 false
买书,书上有接口