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

9th Aug 2020, 6:56 PM
Lorenzo Sandoval
Lorenzo Sandoval - avatar
1 ответ
0
window.location.href will give you the current url
9th Aug 2020, 10:11 PM
JME