In Lesson 15, you learned how to change an element's style by using an element object's
style property, like this:
var someEl = document.getElementById("someElement"); someEl.style.color = "red"; someEl.style.backgroundColor = "gray"; someEl.style.border = "1px solid black";
This code retrieves an element with an
Another issue is performance. To use the
style object you access a DOM object — a poorly performing operation. ...