change the style of a html element in JavaScript

JavaScript
4
function changeStyle() {
var element = document.getElementById("element");
element.style.color = "red";
}
🤖 Code Explanation
This code sets the color of the element with the id "element" to red.

More problems solved in JavaScript




















