Sales tax calculator html code - Html code with java script sales tax html code

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 . 

Here is a code for Sales tax calculator 




<html>

<head>

  <title>Sales Tax Calculator</title>

  <style>

    .container {

      width: 300px;

      margin: 0 auto;

    }

    

    .input-field {

      margin-bottom: 10px;

    }

  </style>

</head>

<body>

  <div class="container">

    <h2>Sales Tax Calculator</h2>

    

    <div class="input-field">

      <label for="subtotal">Subtotal:</label>

      <input id="subtotal" min="0" step="0.01" type="number" />

    </div>

    

    <div class="input-field">

      <label for="taxRate">Tax Rate (%):</label>

      <input id="taxRate" min="0" step="0.01" type="number" />

    </div>

    

    <div class="input-field">

      <button onclick="calculateTax()">Calculate</button>

    </div>

    

    <div class="input-field">

      <label for="total">Total:</label>

      <input id="total" readonly="" type="text" />

    </div>

  </div>

  

  <script>

    function calculateTax() {

      var subtotal = document.getElementById("subtotal").value;

      var taxRate = document.getElementById("taxRate").value;

      

      // Perform validation

      if (subtotal === "" || taxRate === "") {

        alert("Please enter a subtotal and tax rate.");

        return;

      }

      

      var taxAmount = (subtotal * (taxRate / 100)).toFixed(2);

      var total = (parseFloat(subtotal) + parseFloat(taxAmount)).toFixed(2);

      

      document.getElementById("total").value = total;

    }

  </script>

</body>

Comments

Popular posts from this blog

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

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

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