cssText – Add Multiple Styles Using JavaScript
cssText – Adding multiple styles to an element with vanilla JavaScript can feel a bit clunky. The most common approach I’ve seen to style elements with plain JavaScript is to grab your target element, and then add one style at a time. Example: It works, but it’s boring, there’s too much repetition, and you are …