My home page Click me to change the CSS colors of the title of the page Sol61:
Fantastic news! We've Found the answer you've been seeking!
Question:
My home page Click me to change the CSS colors of the title of the page
Sol61:
This is a simple HTML file that includes a h1
element with an id
attribute of mainTitle
, and a button that calls a changeTitleCSSStyle()
function when clicked. The changeTitleCSSStyle()
function changes the background color and font color of the #mainTitle
element. Here's an example implementation of the changeTitleCSSStyle()
function in JavaScript:
function changeTitleCSSStyle() {
var title = document.querySelector("#mainTitle");
title.style.backgroundColor = 'lightblue';
title.style.color = 'navy';
}
Posted Date: