JavaScript and the DOM
- 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>
- Link it to a JavaScript file that you will edit
Using the JavaScript file only (not using a CSS file)
- Change the background color of the entire document to red
- Change the background color of just the "about me" portion to blue
- Change the font-family of the entire document to sans-serif
- Add your nickname
- Add your favorites
- Add your hometown
Extra Credit (still only using JavaScript)
- 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.
- Create a new
img
element and set its src attribute to a picture of you. Append that element to the page.