Href comparision | SoloLearn: Learn to code for FREE!

0

Href comparision

I want to know how to get the url of a page to create a function that allows me to add a class to an <a> element if its "href" attribute matches the current page, all this using jquery. Thanks in advance

8/9/2020 6:56:44 PM

Lorenzo Sandoval

1 Answer

New Answer

0

window.location.href will give you the current url