Question 1 of 30
In a web application, a developer needs to dynamically create a list of items based on user input. The user can add multiple items, and each item should be represented as a list element in an unordered list. After the user submits the items, the developer also needs to implement a feature that allows the user to remove any item from the list by clicking on it. Which approach should the developer take to ensure that the list is created and items can be removed effectively?
Use `document.createElement` to create each list item and attach an event listener to each item for the removal functionality.
Directly manipulate the inner HTML of the unordered list to add items and use a single event listener for the entire list to handle item removal.
Use a framework like React to manage the list state and handle item creation and removal through component re-rendering.
Create a static list in HTML and use JavaScript to hide items instead of removing them from the DOM.

Preparing for Microsoft 98-382 Introduction to Programming Using JavaScript? Now land the interview.

73% of qualified candidates get rejected because of weak resumes. Build an ATS-optimized, recruiter-ready resume in under 5 minutes - free to start.

Build My Resume Free