我可以在#document中获取元素吗?

时间:2019-03-13 04:09:37

标签: javascript jquery

是否可以在#document中获取元素?

enter image description here

此外,我找不到在chrome控制台上使用Jquery的方法。

1 个答案:

答案 0 :(得分:0)

使用iframe.contentDocumentiframe.contentWindow.document

var iframe = document.getElementById("tidio-chat-iframe");
var iframeDocument = iframe.contentDocument || iframe.contentWindow.document;
var myDiv = iframeDocument.querySelector(".frame-content");
//Do something with myDiv
相关问题