In a JS function, I’ve set the background color of a text field like this:
document.getElementsByName(formId)[0].title.style.backgroundColor = "#7FB75E";
In another function, I want to reset the background color to the default value defined in my style sheet. How can I do this?
Just set the value on the “style” object to the empty string.
edit — note that if your element had an inline style, you’d have to explicitly save that somewhere or else you won’t be able to get it back.