0

例如:

<div id="d">ss</d>

如何通过 id 获取 div?

4

2 回答 2

1

在编写 Chrome 扩展程序时,您应该使用 contentWindow 变量访问网页。

contentWindow.document.getElementById("d");
于 2010-05-06T07:05:44.637 回答
0

使用以下语句:

document.getElementById('d');
于 2010-05-06T06:46:38.663 回答