How to Create online calculator code , online calculator code -code for online calculator

Hello friends 

How to Create online calculator code , online calculator code -code for online calculator


 welcome to new post , in this post you will find a code for Online calculator . You can add this code to your website and run your online calculator . 
This code is free and you no need to pay for code now.
We will try to give you a new code for every day . 
You can create your tool website and earn unlimited with google and google adsense. 
You can create your free website with the google product name as Blogger. 
You just open Blogger.com 
create your account and write or paste this code in the html view of your blogger. 

so the Code is given below you can copy and paste in your website . 


<!DOCTYPE html>
<html>
  <head>
    <title>Online Calculator</title>
    <style>
      body {
        font-family: Arial, sans-serif;
      }

      .calculator {
        max-width: 300px;
        margin: 0 auto;
        background-color: #f5f5f5;
        padding: 20px;
        border-radius: 5px;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
      }

      .display {
        background-color: #fff;
        padding: 10px;
        text-align: right;
        margin-bottom: 10px;
        font-size: 24px;
      }

      .buttons {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 10px;
      }

      button {
        padding: 10px;
        font-size: 18px;
        text-align: center;
        background-color: #4CAF50;
        color: white;
        border: none;
        border-radius: 3px;
        cursor: pointer;
      }

      button.clear {
        background-color: #f44336;
      }

      @media (max-width: 600px) {
        .calculator {
          max-width: 90%;
        }
      }
    </style>
    <script>
      function calculate() {
        var display = document.getElementById("display");
        var result;

        try {
          result = eval(display.value);
          display.value = result;
        } catch (error) {
          display.value = "Error";
        }
      }

      function clearDisplay() {
        document.getElementById("display").value = "";
      }

      function addToDisplay(value) {
        document.getElementById("display").value += value;
      }
    </script>
  </head>
  <body>
    <div class="calculator">
      <input type="text" id="display" class="display" readonly>
      <div class="buttons">
        <button onclick="addToDisplay('7')">7</button>
        <button onclick="addToDisplay('8')">8</button>
        <button onclick="addToDisplay('9')">9</button>
        <button onclick="addToDisplay('/')">/</button>
        <button onclick="addToDisplay('4')">4</button>
        <button onclick="addToDisplay('5')">5</button>
        <button onclick="addToDisplay('6')">6</button>
        <button onclick="addToDisplay('*')">*</button>
        <button onclick="addToDisplay('1')">1</button>
        <button onclick="addToDisplay('2')">2</button>
        <button onclick="addToDisplay('3')">3</button>
        <button onclick="addToDisplay('-')">-</button>
        <button onclick="addToDisplay('0')">0</button>
        <button onclick="addToDisplay('.')">.</button>
        <button onclick="calculate()">=</button>
        <button onclick="addToDisplay('+')">+</button>
        <button onclick="clearDisplay()" class="clear">C</button>
      </div>
    </div>
  </body>
</html>

Online Calculator

Online Calculator

Comments

Popular posts from this blog

बस माल पैक करो और कंपनी को वापस कर दो और 60 हजार रुपए महीना कमाओ, bindi packing business

3 ONLINE EARNING APP , NO CONDITION , NO INVESTMENT , ONLY EARNING , घर बैठे पैसा कमाने के लिए 3 सबसे बढ़िया APP .

घर बैठे करे पैकिंग का काम कमाए लाखो रूपये महीना , पॉपकॉर्न कंपनी दे रही है मौका