Skip to content

Instantly share code, notes, and snippets.

@Xiradorn
Last active January 5, 2016 15:22
Show Gist options
  • Save Xiradorn/f0c2b319d60a2decf2ac to your computer and use it in GitHub Desktop.
Save Xiradorn/f0c2b319d60a2decf2ac to your computer and use it in GitHub Desktop.
Global Href Remover except into a container
/**
* 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