html框架问题document.getElementById

日期:2022-04-10 03:32:11 人气:1

html框架问题document.getElementById

iframe里面显示的页面就相当于是另一个页面了,它不属于a.html里的东西,所以它里面的id、class你取不到
可以试试这种方式,不过并非所有浏览器都支持
var _value=document.getElementById('###').contentWindow.document.getElementById('###').value;
    A+
热门评论