HTML COde for Calculator app

Learn how to create mobile calculator app.  

Step - Copy this Html code - 

Learn How to earn money using this app - https://youtu.be/SZWv1dIuC7E

<!DOCTYPE html>
<html>
  <head>
    <style>
      .calculator {
        width: 400px;
        margin: 0 auto;
        text-align: center;
      }
      input[type="text"] {
        width: 100%;
        padding: 10px;
        font-size: 20px;
        text-align: right;
        box-sizing: border-box;
      }
      input[type="button"] {
        width: 50px;
        height: 50px;
        padding: 10px;
        font-size: 20px;
        margin: 10px;
        border-radius: 5px;
      }
    </style>
  </head>
  <body>
    <div class="calculator">
      <input type="text" id="display" disabled />
      <br />
      <input type="button" value="1" onclick="document.getElementById('display').value+='1'"/>
      <input type="button" value="2" onclick="document.getElementById('display').value+='2'"/>
      <input type="button" value="3" onclick="document.getElementById('display').value+='3'"/>
      <input type="button" value="+" onclick="document.getElementById('display').value+='+'"/>
      <br />
      <input type="button" value="4" onclick="document.getElementById('display').value+='4'"/>
      <input type="button" value="5" onclick="document.getElementById('display').value+='5'"/>
      <input type="button" value="6" onclick="document.getElementById('display').value+='6'"/>
      <input type="button" value="-" onclick="document.getElementById('display').value+='-'"/>
      <br />
      <input type="button" value="7" onclick="document.getElementById('display').value+='7'"/>
      <input type="button" value="8" onclick="document.getElementById('display').value+='8'"/>
      <input type="button" value="9" onclick="document.getElementById('display').value+='9'"/>
      <input type="button" value="*" onclick="document.getElementById('display').value+='*'"/>
      <br />
      <input type="button" value="C" onclick="document.getElementById('display').value=''"/>
      <input type="button" value="0" onclick="document.getElementById('display').value+='0'"/>
      <input type="button" value="=" onclick="document.getElementById('display').value=eval(document.getElementById('display').value)"/>
      <input type="button" value="/" onclick="document.getElementById('display').value+='/'"/>
    </div>
  </body>
</html>


Step 2- Paste this html code in notepad.
step 3 - save this file as     text.html
now open it. use this calculator app.


1 comment: