What's new

HTLM code for calculate distance



Brecht B

New member
Hi,

I want on my website a HTML code that calculate the distance from my place (still the same, can be filled in automaticaly) to a place the user choose.
These distance we need to multiply with 1 euro.
BUT: if the distance is 30 km or less, it is for free.
If the distance is more than 30 km, only the km above 30 we need to multiply with 1 euro.

Can somebody help me?

Thanks a lot.
 
Try this code:-
<html>
<head>
</head>
<body>
<h3>Find Distance Between Two Points</h3>
<p><h4>General Formula :</h4></p>
<img src="moomoomath.com/distanc png" width=200px alt="Image Not Available"/>
<p>Enter points x1,x2 and y1,y2</p>
<label>Point X1 :</label>
<br>
<input id="p1" type="number" placeholder="Enter x1">
<br>
<label>Point X2 :</label>
<br>
<input id="p2" type="number" placeholder="Enter x2">
<br>
<label>Point Y1 :</label>
<br>
<input id="p3" type="number" placeholder="Enter y1">
<br>
<label>Point Y2 :</label>
<br>
<input id="p4" type="number" placeholder="Enter y2">
<br>
<br>
<button onclick="calc();">DISTANCE :</button>
<br>
<br>
<div id="output"></div>
</body>
</html>

Hope it helps.

Apps4Rent | O365CloudExperts | CloudDesktopOnline
 


Top