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 :: require() of ES modules is not supported when importing node-fetch 
Javascript :: javascript prepend string to array 
Javascript :: combine two arrays javascript 
Javascript :: day name date js 
Javascript :: feather client 
Javascript :: create label dynamically in javascript 
Javascript :: odd even condition with ternary operator 
Javascript :: var data ="<tr<td"+ data.data[i].name"</td"+"<td"+ data.data[i].email"</td"+"<td"+ data.data[i].create_at"</td</tr"; 
Javascript :: prevent form from reloading with preventDefault 
Javascript :: check if url contains string 
Javascript :: insert condition in a object javascript 
Javascript :: js replace all spaces 
Javascript :: jsconfig.json vue 
Javascript :: error duplicate resources react native 
Javascript :: javascript add spaces to string 
Javascript :: dropzone add download button 
Javascript :: javascript redirect to 
Javascript :: display none javascript 
Javascript :: replace node 
Javascript :: js conditional array element 
Javascript :: reactjs link props 
Javascript :: dont trigger useeffect on start 
Javascript :: Express’s default X-Powered-By header Disabling 
Javascript :: nodejs express return image 
Javascript :: react redux wait for props 
Javascript :: js select disabled 
Javascript :: VM724:1 Uncaught (in promise) SyntaxError: Unexpected token < in JSON at position 0 
Javascript :: check box all in jequery data table 
Javascript :: jquery change picture onclick 
Javascript :: have flat list automatically wrap react native 
ADD CONTENT
Topic
Content
Source link
Name
6+3 =