Labs
-
Create an HTML file named
selecting.htmland a JavaScript file namedselecting.js. -
Write a well-formed HTML document in
selecting.htmland add an<h1>that saysHello world. -
Import your
selecting.jsfile into yourselecting.htmlfile using<script src='selecting.js'></script> -
In your JS file, select the
<h1>element, and use the.textContentproperty to changeHello WorldtoHello (your name). -
Add an unordered list (
<ul>) of 5 list items to the HTML (don't put any text between the<li>s). -
In
selecting.jscreate a JavaScript array with five string values in it. -
Use a selector to access the unordered list's
lis and store the collection into a variable. -
Iterate over the collection of
lis. UsetextContentto insert the values from your array into each of the list items.