Is there a way to disable all hyperlinks in any website using javascript?
The reason I want to do this is for text-selection. Many websites are putting whole blocks of text inside tags, making it difficult to select text.
I use chromium and firefox on kubuntu 13.10.
To disable all links use
$('a').bind("click.myDisable", function() {
return false;
});
and to enable it use
$('a').unbind("click.myDisable");
Okay completely different answer to my deleted answer using what Rob G said.
for (var x=document.links.length-1;x>=0;x--) {
document.links[x].removeAttribute("href")
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With