how to make a calculator website HTML code example

Example: how to make a calculator website HTML

<body>
  
   <center>
    <h1 class="text-danger">Calculator</h1> 
    <p class="q">Type in the numbers to be added, separate them with commas (,). If 'Invalid' shows, you have not used a number, please clear the box and type numbers</p>
   </center>

    <center>
    <h3 style="font-family: Lucida Sans; color: lightseagreen">Add</h3>
    <input class="addinput" type="text">
   <button class="add" style="font-family: Lucida Sans; background-color: lightsalmon">ADD</button>
   <p class="p" style="background-color:lightpink">Sum is <span class="result"></span></p>
   </center>
 
<center>
    <h3 style="font-family: Lucida Sans; color: lightseagreen">Multiply</h3>
  <input class="multiplyinput" type="text">
  <button class="multiply" style="font-family: Lucida Sans; background-color: lightsalmon">MULTIPLY</button>
   <p class="p" style="background-color:lightpink"></p>>Product is <span class="product"></span></p>
</center>

<center>
        <h3 style="font-family: Lucida Sans; color: lightseagreen">Subtract</h3>
    <input class="subtractinput" type="text">
    <button class="subtract" style="font-family: Lucida Sans; background-color: lightsalmon">SUBTRACT</button>
     <p class="p" style="background-color:lightpink"></p>>Difference is <span class="difference"></span></p>
  </center>

  <center>
        <h3 style="font-family: Lucida Sans; color: lightseagreen">Divide</h3>
    <input class="divideinput" type="text">
    <button class="divide" style="font-family: Lucida Sans; background-color: lightsalmon">DIVIDE</button>
     <p class="p" style="background-color:lightpink"></p>>Quotient is <span class="quotient"></span></p>
  </center>
  
   <script src="calculator.js"></script>

</body>

Tags:

Misc Example