Sassa
2 years ago in HTML
<!DOCTYPE HTML>
<html>
<head>
<title>Sassa Family</title>
<script type="text/javascript" language="javascript" src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
<style>
.l {
color: blue
}
</style>
</head>
<body> <script>
$( document ).ready(function() {
$("#num").focus();
});
function calc (){
var v = $("#num").val();
var txt = "<br><label class ='l'>Mama Lena </label>" + (v * 6.25) /100 +"<br><label class ='l'>Safoh </label>" + (v * 21.875) /100 +
"<br><label class ='l'>Rasha </label>" + (v * 10.9375) /100 + "<br><label class ='l'>Lena </label>" + (v * 10.9375) /100 +
"<br><label class ='l'>Rama </label>" + (v * 10.9375) /100 + "<br><label class ='l'>Um Abdulrahman </label>" + (v * 6.25) /100 +
"<br><label class ='l'>Abdulrahman </label>" + (v * 21.875) /100 + "<br><label class ='l'>Razan </label>" + (v * 10.9375) /100 + "<br>========================"
+ "<br>Total : " + v;
$("#res").html(txt);
$("#num").val("") ;
}
</script>
<div style="margin:30px; font-size:x-large">
<h3>Sassa Family</h3>
Input value: <input type="number" id="num">
<button onclick= "calc()"><b>Calc</b></button>
<div id = "res"></div>
</div>
</body>
</html>