有没有办法取消选中/选中在网络浏览器控件中加载的网页中的复选框?谢谢。
更新:(这是我最初尝试过的,但没有成功)
HtmlDocument rememberme = this.webBrowser1.Document;
rememberme.GetElementById("remBox").SetAttribute("checked", "false");
最佳答案
您可以使用:
webBrowser.Document.InvokeScript
参见:
这样你就可以调用 JS 函数来对页面执行你想要的操作。
另一种方法是使用 mshtml API,如下所示:
( ( HTMLInputElement )this.webBrowser1.Document.GetElementById( "test").DomElement ).@checked = false;
关于c# - 通过 WebBrowser 控件取消选中网页中的复选框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1680767/