Jquery – I want to add a class when accessing a specific url
I entered the code as below so that the class is added only in a specific url, but it doesn't work. Could you please help me what is wrong? if(location.href.indexOf('url') > -1){ document.getElementsByClassName('className').classList.add('NewClass'); }