Question
I REALLY need help with his assignment Write a JavaScript in the file named shoppingList.js to get the contents of the input area on the
I REALLY need help with his assignment
Write a JavaScript in the file named shoppingList.js to get the contents of the input area on the left side of the screen and create an entry in the shopping list area on the right of the screen with those contents when a user clicks the button in the middle of the screen.
Check to see if anything was entered in the input area. If nothing was entered, cause an alert window to open up saying that there must be an item entered and then return from the function. If something was entered
1. create an
2. create a
3. add a click handler called deleteItem to the button just created
4. append the button to the
5. create a text node containing the value from the input field
6. append the text node to the
7. append the
- element with id = 'listArea'
- element that contains the button. Use the
- element with id = 'listArea' to remove the
- element that you just found. Modify the deleteItem handler so that it asks the user whether or not to delete the item before deleting it. Only delete the item if the user responds positively.
HERE IS SHOPPING LIST.HTML
Shopping List body{
margin: 0 auto;
width: 80%;
}
header, #inputArea, #outputArea, footer, #buttonArea{
padding: 1em;
color: white;
background-color: #DAA835;
text-align: center;
border: 1px dashed black;
margin-bottom: 10px;
}
#inputArea, #buttonArea{
text-align: left;
width: 30%;
float: left;
}
#buttonArea{
margin-left: 1%;
text-align: center;
}
#outputArea{
text-align: left;
width: 30%;
float: right;
padding-top: 0;
}
#outputArea h3{
margin-top: 0;
}
label, input{
display: inline-block;
}
input{
width: 200px;
}
footer{
clear: both;
}
Shopping List App
Shopping List
Created by: DGB ©2018
- element that you just found. Modify the deleteItem handler so that it asks the user whether or not to delete the item before deleting it. Only delete the item if the user responds positively.
Algorithm for the deleteItem click handler:
Determine the parent of the 'this' object that refers to the current button that was clicked. That would be the
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started