Skip to content

Instantly share code, notes, and snippets.

@leonsas
Created November 19, 2014 16:20
Show Gist options
  • Save leonsas/72c7c120ff89d701d73d to your computer and use it in GitHub Desktop.
Save leonsas/72c7c120ff89d701d73d to your computer and use it in GitHub Desktop.
injector.js
function forEachHTMLCollection(collection, fn){
for (var i = collection.length - 1; i >= 0; i--) {
fn(collection[i]);
};
}
ps = document.getElementsByTagName('p');
forEachHTMLCollection(ps, function(e){
e.style.color = 'white';
});
links = document.getElementById("bodyContent").getElementsByTagName("a")
forEachHTMLCollection(links, function(e){
e.style.background = 'rgba(6, 69, 173,' + Math.random() + ')';
e.style.color = 'white';
});
refs = document.getElementsByClassName('reflist')
forEachHTMLCollection(refs, function(e){
e.style.display = 'none';
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment