Simple CALCULATOR in HTML

Question:

Create the following Web page with the heading ‘Calculator’ and provided images. 

Simple CALCULATOR in HTML
Quiz for Exam – Simple CALCULATOR in HTML

The web page should contain following input elements and apply the specified Constraints:

Label NameElement NameConstraints
Input1input1This element is to get the first input. Type should be ‘number’
Input2input2This element is to get the second input. Type should be ‘number’
Select OperationoperationA drop down list contains the following values: Select.. , ADD, SUBTRACT, MULTIPLY and DIVIDE.Set these values as its option tag text and option tag’s ‘value’ attributes
 submitAn input field with image as type.
 resetAn input field with image as type.

Consider the images are in the current folder and

  • Use “calculator.jpg” as a header image.
  • Use “calc.jpg” as calculation button and “reset.jpg” as reset button.

Apply following styles to the attributes: Do not use CSS . 

  1. The heading should be done using the font color as ‘blue’ and with font size as ’20’. (Use <font> tag)
  2. The height and width of the images with the name “submit” and “reset” should be ’80’.
  3. The height and width of the calculator image should be ‘300’ and ‘400’.

Code:

Calculator.html

<html>
    <body>
            <font size="20" color="blue">Calculator</font><br>
            <img src="https://quizforexam.com/wp-content/uploads/2020/10/Capture.jpg" width="400" height="300"><br>
            Input1<input type="number" name="input1" ><br>
            Input2<input type="number" name="input2" ><br>
            Select Operation <select name=operation>
                <option value="Select..">Select..</option>
                <option value="ADD">ADD</option>
                <option value="SUBTRACT">SUBTRACT</option>
                <option value="MULTIPLY">MULTIPLY</option>
                <option value ="DIVIDE">DIVIDE</option>
            </select><br>
            <input type="image" name="submit" src="https://quizforexam.com/wp-content/uploads/2020/10/calc.bmp" alt="Submit" height="80" width="80">
            <input type="image" name="reset" src="https://quizforexam.com/wp-content/uploads/2020/10/reset.bmp" alt="Reset" height="80" width="80">
    </body>
</html>

Required Resources:

Recommended:

Leave a Comment

Your email address will not be published. Required fields are marked *