/lswebhomework4

JavaScript and the DOM

Primary LanguageHTML

JavaScript and the DOM

  1. Create an HTML file using the following HTML
<!doctype HTML>
<html>
<body>

<h1>About Me</h1>
  
<ul>
	<li>Nickname: <span id="nickname"></span>
	<li>Favorites:  <span id="favorites"></span>
	<li>Hometown: <span id="hometown"></span>
</ul> 

</body>
</html> 

  1. Link it to a JavaScript file that you will edit

Using the JavaScript file only (not using a CSS file)

  1. Change the background color of the entire document to red
  2. Change the background color of just the "about me" portion to blue
  3. Change the font-family of the entire document to sans-serif
  4. Add your nickname
  5. Add your favorites
  6. Add your hometown

Extra Credit (still only using JavaScript)

  1. Iterate through each li and change the class to "listitem". Add a style tag that sets a rule for "listitem" to make the color red.
  2. Create a new img element and set its src attribute to a picture of you. Append that element to the page.