Skip to content

Instantly share code, notes, and snippets.

@therealtakeshi therealtakeshi/help.js
Last active Aug 29, 2015

Embed
What would you like to do?
JS Helper Functions
function styleByClass (className, styleObj) {
var data = styleObj;
var length = document.getElementsByClassName(className).length;
for (var key in data) {
for (var n = 0; n < length; n++) {
document.getElementsByClassName(className)[n].style[key] = data[key];
}
}
}
function checkToReload(obj) {
if (typeof obj !== "undefined") location.reload();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.