Simple Calculator Lab
In this lab, you'll create a simple calculator capable of performing addition, subtraction, multiplication, and division operations. You'll have two input fields for receiving numerical inputs and four buttons for triggering the respective operations.
Upon clicking an operation button, the result will be displayed in a designated area on the page, and the input fields will be reset.
- Create two input elements that accept numbers having ids
- Create four buttons having the following Id's and proper text inside them
- Create a div with id
resultthat displays the output of the performed operations
- You have to create click event listeners for each button, whenever a button is specified the inputs should be read and the output of the performed operation should be displayed in the
- Your code should handle division by Zero errors and any other edge cases that you might encounter.
Note: Your code is verified only by the output it produces in the
#resultelement, make sure that you're adding the output the