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.
例如:
<div id="d">ss</d>
如何通过 id 获取 div?
在编写 Chrome 扩展程序时,您应该使用 contentWindow 变量访问网页。
contentWindow.document.getElementById("d");
使用以下语句:
document.getElementById('d');