Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在 C# 中,我使用 mshtml.HTMLDocument 从页面中检索各种元素。
例如:
button = (mshtml.HTMLButtonElement)theDoc.getElementById("ID1");
现在,如果我运行的是 IE6、IE7、IE8,“ID1”会根据浏览器版本而改变吗?
不,ID 是标签的属性。所以如果你有
<input type="button" id="ID1" ... />
它的 ID 在所有浏览器中都是 ID1。