When making numerous style changes to a single element using JavaScript, phpied and Writing Efficient JavaScript suggest:
instead of applying styles one by one using style.stylename, apply everything in one go using cssText or changing classname as it'll reduce reflows/repaints
What is the preferred method for just a single style change?
document.getElementById('myid').style.cssText += ";color:#999;";
OR
document.getElementById('myid').style.color = "#999";
The comparison on jsperf.com shows that for single style changes, using individual style names is faster than cssText.
Are there any other considerations to keep in mind?