how to calculate balance automatically using javascript and php using cash paid
<!Doctype html>
<html>
<body>
<input id="price">Price
<br><br>
<input id="discount">%
<br><br>
<button onclick="getPrice()">
Get total
</button>
<br><br>
<input readonly id="total">
<script>
getPrice = function() {
var numVal1 = Number(document.getElementById("price").value);
var numVal2 = Number(document.getElementById("discount").value) / 100;
var totalValue = numVal1 - (numVal1 * numVal2)
document.getElementById("total").value = totalValue.toFixed(2);
}
</script>
</body>
</html>
Also in JavaScript:
- different types ways of export and import in javascript
- download .json file
- data table in angular 8 from api
- how to check if a string has only alphabets in javascript
- js check if number has decimals
- angular offline mode
- boucle for in js
- jasmine spy return value when using create Spy Object angular 2
- cJSON_CreateObject
- find key in nested json object
- string to date angular
- javascript how to get the last character of a string
- sample of jstree ajax call code farm
- how to get specific data from json using python
- how to code a check age function in javascript
- javascript select element in dropdown
- javascript style inline react
- keyboard key codes
- javascript get the last array element
- this.setState is undefined inside a async function in js
- check radio button is checked jquery
- how to add array numbers in javascript
- setting up a sprite sheet in js
- looping through an object of objects with arrays