All Rounder Tools Blogger-Best blog for blogger: Sales Tax Calculator tool with colorful styling and all its features use any free library...

Saturday, September 21, 2024

Sales Tax Calculator tool with colorful styling and all its features use any free library...

 

Sales Tax Calculator

Sales Tax Calculator

* { box-sizing: border-box; } body { font-family: 'Arial', sans-serif; background: linear-gradient(135deg, #e3f2fd, #bbdefb); margin: 0; padding: 20px; color: #333; } .container { max-width: 400px; margin: auto; background: white; padding: 20px; border-radius: 8px; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); } h1 { text-align: center; color: #1976d2; } .input-group { margin-bottom: 15px; } label { display: block; margin-bottom: 5px; } input[type="number"] { width: 100%; padding: 10px; border: 1px solid #ddd; border-radius: 4px; } button { width: 100%; padding: 10px; background-color: #1976d2; color: white; border: none; border-radius: 4px; font-size: 16px; cursor: pointer; transition: background-color 0.3s; } button:hover { background-color: #115293; } .output { margin-top: 20px; padding: 10px; border: 1px solid #ddd; border-radius: 4px; background-color: #f9f9f9; white-space: pre-wrap; /* Preserve whitespace for formatting */ text-align: center; font-weight: bold; } document.getElementById('calculate').addEventListener('click', function() { const price = parseFloat(document.getElementById('price').value); const taxRate = parseFloat(document.getElementById('taxRate').value); const output = document.getElementById('output'); if (!isNaN(price) && !isNaN(taxRate)) { const taxAmount = (price * taxRate) / 100; const totalAmount = price + taxAmount; output.innerHTML = `Total Amount: $${totalAmount.toFixed(2)} (Tax: $${taxAmount.toFixed(2)})`; } else { output.innerHTML = 'Please enter valid numbers for price and tax rate.'; } });

No comments:

Post a Comment