I want to know how can I manipulate all the links on a page with javascript. I can get elements by id's with document.getElementById(id)
, but how can I get the links? And also how can I get all elements with a certain classname
? I want to change the color of the link and class elements.
I mean these links:
<a href="http://www.google.com">This is a link</a>
And an example for an element with a class:
<span class="link">This is an element with a class</span>
Please no jquery. I want javascript.
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