Within the script element, declare a variable named list that contains a reference to the only ul element in the document. Also declare empty variables named headingText and TOCEntry.
Added by Rebecca L.
Step 1
You can do this by using `document.querySelector('ul')`, which will return the first `ul` element found. Show more…
Show all steps
Your feedback will help us improve your experience
Sanchit Jain and 66 other AP CS educators are ready to help you.
Ask a new question
Labs
Want to see this concept in action?
Explore this concept interactively to see how it behaves as you change inputs.
Key Concepts
Recommended Videos
To define a list in HTML, use the <ul> tag for an unordered list, the <ol> tag for an ordered list, and the <li> tag for each list item.
Sanchit J.
Problem Statement: Design and build a program that allows a user to enter a series of names in a text box within a form on a web page. The names are entered one at a time, with the user clicking a button to submit each name. The names are stored in an array as each name is entered. As new names are entered and added to the array, display the names in an HTML table below the form. Displayed above the table, there must be a total of how many names have been entered. This total will be calculated from the names in the array and not with a counter. Program modules must be used for clarity and ease of future maintenance, although no specific number of functions is mandated as long as there are at least two. For full credit, you must display the entire contents of the array each time a name is submitted. But only the contents of the array should be displayed. Do not display individual elements in the array more than once.
Akash M.
Recommended Textbooks
Computer Science and Information Technology
Introduction to Programming Using Python
Computer Science - An Overview
Transcript
18,000,000+
Students on Numerade
Trusted by students at 8,000+ universities
Watch the video solution with this free unlock.
EMAIL
PASSWORD