Programming Examples

JavaScript program to convert any amount from dollar to rupee


dollar to rupee

Write a JavaScript Code to Convert any Amount from Dollar to Rupee.

<html>
	<head>
		<title>Doller to Rupee or Rupee to Dollar Convertor</title>
		<script>
			function dollar_to_rupee(amt)
			{
				rs=amt*73.66
				document.getElementById("t2").value=rs;
			}
			function rupee_to_dollar(amt)
			{
				rs=amt/73.66
				document.getElementById("t1").value=rs;
			}
		</script>
	</head> 
	<body>
		<h4>73.66 Indian Rupee</h4>
		<input type="number" id="t1" value="1" onblur="dollar_to_rupee(this.value)"/> Dollar <br/> <br/>
		<input type="number" id="t2" value="73.66" onblur="rupee_to_dollar(this.value)"/> Rupee
	</body>
</html>
Output

CCC Online Test 2021 CCC Practice Test Hindi Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Best Java Training Institute in Prayagraj (Allahabad) Best Python Training Institute in Prayagraj (Allahabad) O Level NIELIT Study material and Quiz Bank SSC Railway TET UPTET Question Bank career counselling in allahabad Sarkari Naukari Notification Best Website and Software Company in Allahabad Website development Company in Allahabad