I need help in how to grab the third tag in array <a>
//something like this
var links = document.getElementsByTagName("a[2]");
is this the proper way to do it?
2 replies to this topic
#1
Posted 09 November 2011 - 08:41 AM
|
|
|
#2
Posted 09 November 2011 - 07:46 PM
getElementsByTagName() will get you an array.
So I believe the correct statement should be
var links = document.getElementsByTagName("a")[2];
So I believe the correct statement should be
var links = document.getElementsByTagName("a")[2];
#3
Posted 10 November 2011 - 09:07 AM
tried that but still not working even though I think thats the correct way.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users


Sign In
Create Account

Back to top









