logo image

Calculate Interest with HTML, javascript & jQuery

Views: 188

Demo

Code

<html>
<head>
<script src = "https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"> </script>
<script>
$(document).ready(function(){
	 $("#totalamount").click(function(){
	var p = $("#actualmoney").val();
	var t = $("#persentage").val();
	var r = $("#months").val();
	var intrest = ((+p) * (+t) * (+r)) / 100; 
	 $("#intrestResult").val(intrest)
	  $("#totalResult").val((+p) + intrest)
});
});
</script>
</head>
<body>
<div>
Enter your actual money:
<input type = "text" id = "actualmoney"><br><br>
 Enter your intrest persentage:
  <input type = "text" id = "persentage"><br><br>
   Enter your months:
  <input type = "text" id = "months"><br><br>
<button type = "button" id = "totalamount">Totalamount</button><br><br>
Intrestamount:
<input type = "text" id = "intrestResult">
Totalamount:
<input type = "text" id = "totalResult">
</div>
</body>
</html>
We are looking for Interns!
Send your resumes to
[email protected]