Question: NEED HELP DIRECTIONS: Notice that there is one input area and one input button There is a place in the HTML reserved for elements under
NEED HELP
DIRECTIONS:
Notice that there is one input area and one input button
There is a place in the HTML reserved for elements under the heading Shopping List
Write a javascript program that will cause whatever the user inputs to be placed in a newly -created
tag and the tag placed inside theelement whenever the user clicks the button
Your program must not create any
tag is the user clicks the button without entering anything in the input area. If the user does that, the program should display a message within the tag set aside for the error messages.
General Algorithm: (Stuff is missing that you have to fill in)
Make the + button clickable so that it will:
Get the data entered by the user when the button is clicked.
Check to see if the user entered something. If she did:
Create a new
tag using document.createElement{li)
Assign the value entered by the user to the new tag.
Append the new tag to the
element with the id =list
Else
Put an error message in between the span tags with id=error
Make the clear button clickable so that it will clear the contents of the
tag.
HTML
Enter a list item:
Click button to add item to the list:
+
Click button to clear the list:
Clear
Shopping List
Shopping List
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
