How to select an element and manipulate it
This is just a simple example I made today that shows how I was able to manipulate the h2 tag on this page.
As you can see it selects the h2 and changes the color to white then black every 1 second.
I’m sure you won’t stay for longer than 2 seconds on this page.
See if you can try manipulating anything on this page yourself by opening the console
<h2>How to select an element and manipulate it</h2>
var h2 = document.querySelector("h2");
var isWhite = false;
h2.style.color = "white";
h2.style.color = "black";
isWhite = !isWhite;
The Document interface has a huge list you can use to do all kinds of things, this is just a list of the one’s I learned how to use.
I can see how they can be used pretty commonly.
Common Methods of DOM
To learn more about DOM check out: