Is there anyway I can use a javascript code to add a class to EVERY link on a website?
The reason I am doing this is that I’m adding a fade in and fade out for all links that switch pages on my website, however I must add the class=”transition” to all links on the site.
There has to be an easier way than editing all links. . .
Thanks guys!
In jQuery, you would simply do this (It should be fairly self-explanatory):
Although, if you can select all of the links to add a class, couldn’t you just do the fade in/out on the link tag instead of the class? I guess I’m trying to understand how you are doing your fading in and out.