Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript get element by class name change style

const boxes = document.querySelectorAll('.box');

boxes.forEach(box => {
  box.style.backgroundColor = 'purple';
  box.style.width = '300px';
});
Source by bobbyhadz.com #
 
PREVIOUS NEXT
Tagged: #javascript #element #class #change #style
ADD COMMENT
Topic
Name
8+9 =