How would you select all the links inside a certain div, using jquery
?
<div id="content">
<!-- SELECT ALL LINKS IN THIS DIV -->
<a href="mysite.com">My site</a>
<a href="mysite.com">Link 2</a>
</div>
<div id="footer">
<a href="alink.com">Don't select any links from this div</a>
</div>
Lee, the problem with that, is that if you have an anchor, you will be selecting it too..
Have you noticed how you could this too? It's a bit safer I would say...
$('#content a[href]')
In case you had a simple anchor you wouldn't want selected..
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With