CJCoding With Joseph

Clear a List's Contents

Select the list with id="todos" and remove all of its items by setting its innerHTML to an empty string. The <ul> itself must remain.

Platform-Provided HTML (READ-ONLY):
<ul id="todos">
  <li>Task 1</li>
  <li>Task 2</li>
</ul>

Steps:
1. Select the list with document.getElementById().
2. Set its innerHTML to "" (an empty string).

Expected Output:

<ul id="todos"></ul>
Topics:
HTML DOM
Code Editor
1
Tab to indent ยท Ctrl+Enter to run ยท Ctrl+Space to expand shortcuts (clog, fn, fori)

Your Output

Run your code to see the output here...

Test Cases

Run your code to see test case results.