Labs

  1. Create an HTML file named selecting.html and a JavaScript file named selecting.js.

  2. Write a well-formed HTML document in selecting.html and add an <h1> that says Hello world.

  3. Import your selecting.js file into your selecting.html file using <script src='selecting.js'></script>

  4. In your JS file, select the <h1> element, and use the .textContent property to change Hello World to Hello (your name).

  5. Add an unordered list (<ul>) of 5 list items to the HTML (don't put any text between the <li>s).

  6. In selecting.js create a JavaScript array with five string values in it.

  7. Use a selector to access the unordered list's lis and store the collection into a variable.

  8. Iterate over the collection of lis. Use textContent to insert the values from your array into each of the list items.


Prev -- Up