I'm trying to modify a link so it shows javascript:void(0) when the link is hovered over.
$(document).ready(function(){
if( $('.loggedinusername').length ) {
$("div#moresearches ul").append("<li id='xxx'><a href='https://exmample.org'>Link</li>");
}
});
I've tried:
$(document).ready(function(){
if( $('.loggedinusername').length ) {
$("div#moresearches ul").append("<li id='xxx'><a href='javascript:void(0)' onclick="location.href='https://example.org'>Link</li>");
}
});
But it doesn't seem to work. I noticed that there are issues with the apostrophes but I can't seem to sort out how to make them work. Let me know if you need any more clarification and I'd happily provide it. Any help would be appreciated.