Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

how to change the color using 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>
Comment

how to change color on js

document.getElementBiId("your id").style.color = "your color";
//it can also be used as:
document.body.style.backgroundColor = "your color";
Comment

javascript change color

var span = document.getElementsByTagName("span")[0];
span.style.color = "red";
Comment

PREVIOUS NEXT
Code Example
Javascript :: is knex built into node js 
Javascript :: capitalize name function javascript 
Javascript :: discord.js remove embed from message 
Javascript :: angular ng-click toggle class 
Javascript :: javascript base64 to length 
Javascript :: get all child element of class javascript 
Javascript :: javascript how to get rid of e with number input 
Javascript :: sweet alert 2 react 
Javascript :: disabling ctrl + s using javascript 
Javascript :: how to add a letter to a string javascript 
Javascript :: How to reset ReactJS file input 
Javascript :: sum index of an array javascript 
Javascript :: access json object in javascript loop 
Javascript :: lodash count duplicates in array 
Javascript :: funciones invocan a funciones javascript 
Javascript :: new line in rdlc expression 
Javascript :: prevent refresh react 
Javascript :: Not Found The requested URL was not found on this server angular routing when going back to site from ecternal source 
Javascript :: post to /wp-json/wp/v2/media 
Javascript :: npm install could not resolve peerDependencies 
Javascript :: mongodb check if collection exists 
Javascript :: paragraph antd 
Javascript :: conditional (ternary) operator function parameter 
Javascript :: merge objects javascript es6 
Javascript :: updatable time js 
Javascript :: vue dynamic routes with parameters 
Javascript :: javascript await return value 
Javascript :: is string undefined null or empty c# javascript 
Javascript :: mongoose query using an arry 
Javascript :: axios get data from json file 
ADD CONTENT
Topic
Content
Source link
Name
6+6 =