Created
November 15, 2018 16:00
-
-
Save armanhakimsagar/3f74027bf27b6d0cf7e84a6e323bf45b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html> | |
| <body> | |
| Price : | |
| <input id="price" oninput="priceSet()" type="text"><br><br> | |
| Dis : <input id="dis" type="text" oninput="disSet()"><br><br> | |
| Vat : <input id="vat" type="text" oninput="vatSet()"><br><br> | |
| Net Price : <input id="netprice" type="text"> | |
| <script> | |
| function priceSet() { | |
| var price = document.getElementById('price').value; | |
| document.getElementById("netprice").value = price; | |
| } | |
| function disSet() { | |
| var dis = document.getElementById('dis').value; | |
| var price = document.getElementById('price').value; | |
| document.getElementById("netprice").value = price - price*dis/100; | |
| } | |
| function vatSet() { | |
| var dis = document.getElementById('dis').value; | |
| var price = document.getElementById('price').value; | |
| var vat = document.getElementById('vat').value; | |
| disprice = price - price*dis/100; | |
| current_vat = disprice*vat/100; | |
| vatprice = current_vat + disprice; | |
| document.getElementById("netprice").value = vatprice; | |
| } | |
| </script> | |
| </body> | |
| </html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment