如何获取 iframe
的高度和宽度,从以下位置执行脚本
在 iframe
之外?
我想找到它的尺寸。
欢迎 JavaScript 解决方案。
最佳答案
使用纯 JavaScript:
document.getElementsByTagName('iframe')[0].getAttribute('width');
document.getElementsByTagName('iframe')[0].getAttribute('height');
关于javascript - 如何获取 iframe 的高度和宽度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29804882/