Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
187
rated 0 times [  193] [ 6]  / answers: 1 / hits: 35043  / 10 Years ago, wed, march 19, 2014, 12:00:00

I am trying to test something, and for one reason or another, while working in the Firebug console, I am unable to create an array of script tags on the HTML page using the getElementByTagName('script') method. I realize there is probably something stupid I am overlooking.



This is the dummy HTML page:



<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>




And this is what I'm typing into the Firebug console:



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


enter






All selected in Console
enter


More From » html

 Answers
10

You have info selected, it will only show info. Click the All button!



enter



And to show that it makes a difference, new screenshots



enter


[#71902] Tuesday, March 18, 2014, 10 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
karladaijahf

Total Points: 78
Total Questions: 123
Total Answers: 89

Location: Liechtenstein
Member since Wed, Dec 8, 2021
3 Years ago
;