Last active
January 5, 2016 15:22
-
-
Save Xiradorn/f0c2b319d60a2decf2ac to your computer and use it in GitHub Desktop.
Global Href Remover except into a container
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Global Href Remover except links into container | |
* @author Sir Xiradorn <http://xiradorn.it> | |
*/ | |
(function(){ | |
// config | |
var config = { | |
id : 'fmenu', | |
colorTxt : 'gray', | |
cursor : 'not-allowed' | |
}; | |
var x = document.getElementsByTagName('a'); | |
for (i=0; i<x.length; i++) { | |
var nodeGrabber = x[i].parentNode.parentNode; | |
if (nodeGrabber.getAttribute('id') !== config.id) { | |
x[i].removeAttribute('href'); | |
x[i].style.cursor = config.cursor; // for rage increasing :lol: | |
x[i].style.color = config.colorTxt; | |
x[i].style.textDecoration = 'none'; | |
} | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment