问题

我正在尝试测试某些东西,出于某种原因,在Firebug控制台中工作时,我无法使用getElementByTagName('script')方法在HTML页面上创建一个脚本标记数组.我意识到可能有一些愚蠢的东西我忽略了.

这是虚拟HTML页面:

 <html>
<head>
    <title>Random Crapolla Page</title>
    <h1>Random Crapolla Page</h1>
</head>

<body>
    <div id="whyNot">
    <p id="p1">
        <a href="http://google.com">Here is link one</a><br />
        <a href="http://google.com">Oh poop here's another</a><br />
        <a href="http://google.com">And a 3rd for good measure</a><br />
    </p>

    <a id="p2">
        Latin. Latin. Latin...<br />
        Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum
    </p>
    </div>
    <!-- Script tag testing-->
    <script type="text/javascript" src="itDoesntExist.js"></script>
    <script type="text/javascript" src="dummyJSnumeroDos.js"></script>
</body>
 

这是我输入Firebug控制台的内容:

 var scripts = document.getElementsByTagName('script');
console.log(scripts);
 

enter image description here


所有在Console中选择 enter image description here

  最佳答案

您选择了信息,它只显示信息.单击所有按钮!

enter image description here

并显示它有所不同,新的屏幕截图

enter image description here

  相同标签的其他问题

javascripthtmlfirebugconsole.log