08. Create Append πŸ‘©β€πŸŽ“πŸ‘¨β€πŸŽ“

πŸ—οΈ Create an Ordered List Using JavaScript

Work with a partner to implement the following user story:

  • As a blogger, I want to use JavaScript to create an ordered list of my favorite foods on my webpage.

Acceptance Criteria

  • It’s done when an ordered list containing four favorite foods is visible in the HTML below the text “My favorite foods are:”

  • It’s done when the ordered list has a background color of #333333 and padding of 20px.

  • It’s done when each list item has a font color of white, padding of 5px, and margin-left of 35px.

  • It’s done when each list item has a different background color.

Assets

The following image demonstrates the web application’s appearance and functionality:

The text "Welcome to my page," appears above a centered kitten photo, above the text "My favorite foods are:" and a list of four foods.


πŸ’‘ Hints

After creating an element in JavaScript, what additional step must you take to attach the element to the HTML document?

πŸ† Bonus

If you have completed this activity, work through the following challenge with your partner to further your knowledge:

  • What is the difference between append() and appendChild()?

Use Google or another search engine to research this.


βœ… Solutions

Solutions Click Here