0

在 C# 中,我使用 mshtml.HTMLDocument 从页面中检索各种元素。

例如:

button = (mshtml.HTMLButtonElement)theDoc.getElementById("ID1");

现在,如果我运行的是 IE6、IE7、IE8,“ID1”会根据浏览器版本而改变吗?

4

1 回答 1

3

不,ID 是标签的属性。所以如果你有

<input type="button" id="ID1" ... /> 

它的 ID 在所有浏览器中都是 ID1。

于 2009-07-16T15:54:28.643 回答