Andrei Maieras Andrei Maieras - 1 year ago 97
HTML Question

Get nested element by tag->id->element with javascript


I want to get all the a elements from a
with id
. I think above syntax is wrong. Can anyone point me in the right direction?

Answer Source

Try this


Or for IE8+

document.querySelectorAll('#menuArea a')
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download