I'm currently running the following code to apply an array of css attributes to mimic jquery (I'm not allowed to use jquery) but the loop is only grabbing the first node:
HTMLElement.prototype.css = function(attr) {
for(i in attr){
return this.style[i] = attr[i];
}
}
button.css({
'width': '58px',
'height': '55px',
'font-family': 'century gothic',
'font-weight': 'bold',
'padding-left': '2px',
'padding-top': '0',
'outline': 'none'
});
What is wrong with my loop?
returnwhich breaks theforloop