在页面中嵌套了iframe
获取iframe中的window对象:iframe.contentWindow
获取iframe中的document:iframe.contentDocument
ie6,7不支持contentDocument,改用以下方式
iframe.contentWindow.document
剩下的操作dom就和平常一样了
在ie,firefox,chrome中都可以兼容,不过在chrome中需要在web服务中才可以的,本地文件不行
在页面中嵌套了iframe
获取iframe中的window对象:iframe.contentWindow
获取iframe中的document:iframe.contentDocument
ie6,7不支持contentDocument,改用以下方式
iframe.contentWindow.document
剩下的操作dom就和平常一样了
在ie,firefox,chrome中都可以兼容,不过在chrome中需要在web服务中才可以的,本地文件不行