how to change test colo on js button 1

how to change test colo on js button

var about;   
function init() { 
    about = document.getElementById("about").innerHTML;
    about.style.color = 'blue';
}

Here is what the above code is Doing:
1. We create a variable called about and assign it the value of the HTML element with the id of about.
2. We then change the color of the text in the about element to blue.

Now, let’s add the init() function to the onload event handler of the body element.

Now, when the page loads, the init() function will be called and the text in the about element will be blue.

Similar Posts