你的位置:首页 > 软件开发 > ASP.net > Winform webbrowser 隐藏 html 元素

Winform webbrowser 隐藏 html 元素

发布时间:2015-11-07 14:00:08
目的:用webbrowser打开网页,并隐藏网页上某个html元素1.如果已知元素ID,比较好办直接使用webbrowser1.Document.getElementById("id")获取元素,并修改属性1 HTMLDocument thedocument ...

目的:用webbrowser打开网页,并隐藏网页上某个html元素

1.如果已知元素ID,比较好办

直接使用webbrowser1.Document.getElementById("id")获取元素,并修改属性

1 HTMLDocument thedocument = WebBrowser.document.all; 2 HTMLElement theelement = thedocument.getElementById(""); //这里找你要藏的东西的ID; 3 theelement.setAttribute("visible",false); 4 或者5 HtmlElement htm = webBrowser1.Document.GetElementById("控件ID"); 6 htm.OuterHtml = ""; 

原标题:Winform webbrowser 隐藏 html 元素

关键词:HTML

*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们: admin#shaoqun.com (#换成@)。