Run ยป
<!DOCTYPE html> <html> <body> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js" type="text/javascript"></script> </head> <h1>GST Calculation</h1> <form method="post" action=""> <input type="hidden" name="mode" value="PinRequest" /> <label><b>Fee</b></label> <input class="w3-input w3-border" name="pages" id="pages" type="text"><br><br> <label><b>Total Amount</b></label> <input class="w3-input w3-border" name="tot_amount" id="tot_amount" type="text"> <input type="submit" name="save" value="submit"> </form> <script> $(document).ready(function() { $('#pages').keyup(function(ev) { var total = $('#pages').val() * 1; var tot_price = total + (total * 0.18); var divobj = document.getElementById('tot_amount'); divobj.value = tot_price; }); }); </script> <body> </html>