html Copy code GST Calculator

GST Calculator

Results:

CSS (styles.css) css Copy code body { background-color: #f8f9fa; } .card { border-radius: 10px; } .card-header { border-top-left-radius: 10px; border-top-right-radius: 10px; } .btn-success { background-color: #28a745; border: none; } .btn-success:hover { background-color: #218838; } .text-info { font-size: 1.2em; } JavaScript (script.js) javascript Copy code document.getElementById('gst-form').addEventListener('submit', function (event) { event.preventDefault(); // Get the input values const amount = parseFloat(document.getElementById('amount').value); const gstPercentage = parseFloat(document.getElementById('gst-percentage').value); // Calculate GST and total amount const gstAmount = (amount * gstPercentage) / 100; const totalAmount = amount + gstAmount; // Display the results document.getElementById('gst-amount').textContent = `GST Amount: ₹${gstAmount.toFixed(2)}`; document.getElementById('total-amount').textContent = `Total Amount: ₹${totalAmount.toFixed(2)}`; });