CSS with javascript

 element.style.backgroundColor = "red";

//https://www.geeksforgeeks.org/how-to-generate-a-simple-popup-using-jquery/

https://www.geeksforgeeks.org/difference-between-mouseover-mouseenter-and-mousemove-events-in-javascript/

document.getElementById("yourElement").style.cssText = cssString;

or

document.getElementById("yourElement").setAttribute("style",cssString);

Example:

document
.getElementById("demo")
.style
.cssText = "margin-left:100px;background-color:red";

document
.getElementById("demo")
.setAttribute("style","margin-left:100px; background-color:red");

Comments

Popular posts from this blog

interview questions js[ Anurag Singh ProCodrr]

reactnative_creation