To change the CSS properties of an element, follow this syntax:
document.getElementById(id).style.property = new value
For example, say we want to change the text color, font-family, and font-weight of a paragraph tag with id = “p1”:
let p1 = document.getElementById(“p1”); p1.style.color = “blue”; p1.style.fontFamily = “Times New Roman”; p1.style.fontWeight = “bold”;
This makes the text in the p1 tag blue and bolded, and changes the font to Times New Roman.
Add a page link block here (if there is no next section, delete this column)