Javascript Webpage Links Disable

Disable Links on a Webpage with JavaScript

A JavaScript bookmarklet that disables the 'href' of 'a' tags on webpages so that clicking them doesn't navigate to external pages. This might be useful when you frequently do double-click copying. Uses document.getElementsByTagName and document.removeAttribute.

Shou Arisaka
1 min read
Nov 15, 2025

A JavaScript bookmarklet that disables the “href” of “a” tags on webpages so that clicking them doesn’t navigate to external pages. This might be useful when you frequently do double-click copying. Uses document.getElementsByTagName and document.removeAttribute.

for (i = 0; i < document.getElementsByTagName('a').length; i++){
    document.getElementsByTagName('a')[i].removeAttribute('href') ; 
}

Share this article

Shou Arisaka Nov 15, 2025

🔗 Copy Links