As previously noted, JavaScript is a scripting language that uses objects. For example, your browser window is an object, which contains the document object. The document object, in turn, contains the body object, which includes the style object.
We can refer to these objects via JavaScript by using dot notation. For example, "window.document.body.style"
Using dot notation, we can access objects and change their properties.
The following dot notation reference can change two properties of the body.style object. We use window.document.body.style to access that object. These properties are referenced with the following code:
window.document.body.style.backgroundColor - This property is the background color of the body.
window.document.body.style.color - This property is the text color of the body.
Here, we change the window.document.body.style. properties as follows:
<script>
// Change the object properties
// Change the background color
window.document.body.style.backgroundCOlor="indianred"
// Change the text color
window.document.body.style.color="white";
</script>