In this lesson, we open up the browser developer console to inspect the HTML within.
Use CMD + OPT + i to open the console quickly.
0:30 Opening this up, you can see the HTML of this page. In the body, we have a paragraph tag of "peanut butter falcon." To access this paragraph tag directly, we can type document.body.firstElementChild. Now you can see we have a reference to this HTML tag.
0:57 We can even change it. Document.body.firstElementChild.innerText = "Knives Out." Now you can see that the text of our paragraph tag is "Knives out." If we log out the paragraph, we can see that it's changed.
1:29 When we reload the page, it goes back to what our actual HTML on our file has displayed.
You must be a Pro Member to view code
Access all courses and lessons, track your progress, gain confidence and expertise.