如何将元素iframe放入iframe?

时间:2018-11-22 15:46:52

标签: javascript reactjs iframe htmlcollection

如何将元素iframe放入iframe? JS HTMLCollectiion获得0元素返回未定义?

<script>
    var iframe = document.getElementsByTagName('iframe');
    var gbooking = document.getElementById('GbookingWidget');
    console.log(gbooking); //null
    console.log(iframe); // HTMLCollection
    console.log(iframe[0]); //undefined
    console.log(iframe.item(0)); //null
</script>

console html

0 个答案:

没有答案