add style javascript
// Bad:
element.setAttribute("style", "background-color: red;");
// Good:
element.style.backgroundColor = "red";
add style javascript
// Bad:
element.setAttribute("style", "background-color: red;");
// Good:
element.style.backgroundColor = "red";
add css in javascript
document.getElementById("demo").style.display = "none";
javascript add css file
var cssFile = document.createElement('link');
cssFile.rel = 'stylesheet';
cssFile.href = "styles.css"; // or path for file {themes('/styles/mobile.css')}
document.head.appendChild(cssFile); // append css to head element
how to give css style in javascript
document.getElementById("myH1").style.color = "red";
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us