how to change color on js
<!DOCTYPE html>
<html>
<head>
<script>
function display()
{
var col=document.getElementById("demo");
col.style.color="#FF0000";
}
</script>
</head>
<body>
<h1>My First JavaScript</h1>
<p id="demo">click on the button below.....</p>
<button onclick="display()">Display</button>
</body>
</html>document.getElementBiId("your id").style.color = "your color";
//it can also be used as:
document.body.style.backgroundColor = "your color";
Also in JavaScript:
- fullscreen electron
- js oneline foreach
- javascript prevent iframe interaction
- express
- jquery scrollHeight
- jquery script
- javascript keywords
- npm express-session
- javascript set element width
- chess.js
- get first object key javascript
- how to add object to array javascript
- error build react Failed to execute 'replaceState' on 'History': A history state object with URL 'file:///' cannot be created in a document with origin 'null' and URL
- java script hash
- if else jquery click function
- ternary operator in angular
- javascript date format
- javascript animate elements
- javascript detect browser
- async useeffect
- android intent data as jsonobject
- js scroll to bottom
- truthy and falsy values in javascript
- javascript algorithms