Answers for "set multiple styles for one elementwith js"

CSS
1

setting multiple css using dom

document.getElementById("myElement").style.cssText = "display: block; position: absolute";
Posted by: Guest on November-07-2020
0

how to add multiple styles in javascript

Object.assign(yourelement.style,{fontsize:"12px",left:"200px",top:"100px"});
Posted by: Guest on September-02-2020

Browse Popular Code Answers by Language