Question
Please add the full of javascript code(By typed) into the HTML&CSS code following the Javascript requirement blow, thank you so much HTML&CSS :
Please add the full of javascript code(By typed) into the HTML&CSS code following the "Javascript requirement" blow, thank you so much
HTML&CSS:
"
body { | |
background-color: #ddd; | |
font-family: sans-serif; | |
} | |
#main-container { | |
width: 750px; | |
background-color: white; | |
margin:0 auto; | |
text-align: center; | |
padding: 10px; | |
} | |
#calculator-wrapper #input-wrapper { | |
margin: 40px 0 20px; | |
} | |
#calculator-wrapper #input-wrapper label { | |
font-size: 18px; | |
margin: 0 4px; | |
font-style: italic; | |
} | |
#calculator-wrapper #input-wrapper input { | |
font-size: 20px; | |
padding: 4px; | |
border: 2px solid #bbb; | |
background-color: #eee; | |
} | |
#calculator-wrapper #button-wrapper { | |
margin: 20px 0; | |
} | |
#calculator-wrapper #button-wrapper button { | |
font-size: 20px; | |
margin: 0 5px; | |
} | |
#results { | |
margin: 20px; | |
background-color: #eee; | |
border: 2px solid #bbb; | |
font-size: 24px; | |
padding: 14px; | |
overflow-x: auto; | |
min-height: 25px; | |
} | |
ITMD 465/565 - Lab 1 - Simple Calculator | |
Your First and Last Name - Your Email address | |
// Begin all JavaScript Code Here - Do not put JavaScript outside these comments. | |
// End all JavaScript Code Here - Do not put JavaScript outside these comments. | |
"
Javascrpit requirement:
"1. Put in value 1 and value 2.
2. Click any of the buttons (add, subtract, multiply, divide) and it will do that operation to value 1 and value 2 and show the answer in the results box.
3. If value 1 or value 2 is blank or not a number you need to instead show an alert prompt stating that one of the two values are not a number or empty and do not show any results in the results box.
4. If a letter or non-number character is put in a value box it should show an alert error saying so.
5. If the reset button is clicked it should clear out all the values in value 1, value2, and the results box. o Prevent the user from trying to divide by zero. If they try to divide by zero prompt them with an alert error.
6. Each of the five buttons should have a corresponding event handler function that has been attached to the click event on the respective button. Use the addEventListener method, do not modify the HTML to add an onclick attribute."
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