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 :: es ignore 
Javascript :: pass props in link next js 
Javascript :: vanilla javascript fade out 
Javascript :: foreach in javascript 
Javascript :: django pass list to javascript 
Javascript :: axios get data 
Javascript :: jquery remove focus from all elements 
Javascript :: Error: Not implemented: window.alert 
Javascript :: hover con js 
Javascript :: react private route 
Javascript :: preload javascript 
Javascript :: add an array to another array javascript 
Javascript :: leaflet each layer 
Javascript :: how to customize js alert box 
Javascript :: calculate width of text javascript 
Javascript :: nodejs console.log timestampt 
Javascript :: e.target.text react 
Javascript :: fetch catch 
Javascript :: why is my deleteOne mongoose middleware not working 
Javascript :: datatable get row data 
Javascript :: react native gradient 
Javascript :: js loop over array of objects extract value 
Javascript :: checkbox set checked jquery 
Javascript :: key value json javascript 
Javascript :: how to separate thousands with comma in js 
Javascript :: js Write a function that will return a random integer between 10 and 100 
Javascript :: setinterval js 
Javascript :: check if browser is internet explorer js 
Javascript :: angular ngmodel checkbox 
Javascript :: tinymce event on change 
ADD CONTENT
Topic
Content
Source link
Name
2+4 =