Consider, we have following html markup:
<div id="container"> <p>Hello this is some text</p> </div>
Now, we want to change the text or font color of the content present inside the
document.querySelector() methods and set its
property to your desired color.
Here is an example, that changes the text color to
const div = document.getElementById("container"); div.style.color = "orange";