Med input felter til at taste tallene ind i:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "
http://www.w3.org/TR/html4/loose.dtd"><html>
<head>
<title>I Vinkel ;-)</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script type="text/javascript"><!--
function gEl(strId){return document.getElementById(strId)}
function beregn(){
with (Math){
var hh = +gEl("heightInput").value;
var ww = +gEl("widthInput").value;
if (!isNaN(hh) && !isNaN(ww) && ww!=0){
gEl("angleInput").value = atan(hh/ww)/PI*180.0
} else {
gEl("angleInput").value = "NaN";
}
}
}
//--></script>
</head>
<body>
<form action="" method="get" name="vinkelForm">
Bredde:<br>
<input type="text" size="10" name="widthInput" id="widthInput" value="1.23"><br>
Højde:<br>
<input type="text" size="10" name="heightInput" id="heightInput" value="1.23"><br>
<input type="button" value="Beregn" onclick="beregn()"><br>
Vinkel:<br>
<input type="text" size="17" name="angleInput" id="angleInput" value="" disabled="disabled"><br>
</form>
</body>
</html>