I want to change the href of tag using jquery.
This is the html code:
<a href="exampleurl" id="a_theme" onClick="return activate_theme();">Click</a>
This is the jquery code:
function activate_theme(){
$("#a_theme")).attr("href", "new url");
}
It displays an error :
activate_theme is not defined
1st way:
2nd way: