hello
i have a simple question
lets say i have this code
<div id="myid">
<a href="#">link</a>
</div>
well..
inside the JavaScript i can call the div using document.getElementById("myid")
but i want to call the <a></a> which is inside this div
i want to call the link not the div and i don't have the link name or its id
thanks
Page 1 of 1
how can i call element +js
#2
Posted 24 January 2012 - 12:19 PM
Once you have the DIV, simply find all As within it:
var div = document.getElementById('mydiv'),
a = div.getElementsByTagName('a')[0];
Share this topic:
Page 1 of 1
Help















