I have this part of a function that sets css properties on two buttons (update, save). I'm trying to minimize the lines of code and i'm looking for a more efficient way of setting css properties on multiple HTML elements rather than writing getElementById for every element. Is querySelectorAll suitable for use in this context?
//Chris
var css = {"backgroundColor": "red","textDecoration": "line-through"};
for (var prop in css) {
document.getElementById("update").style[prop] = css[prop];
document.getElementById("save").style[prop] = css[prop];
}
.style.