<!DOCTYPE html>
<head>
<script language="javascript">
function calcola(){
var l1= document.getElementById('l1').value;
var l2= documenet.getElementById('l2').value;
var l3= document.getElementById('l3').value;
if((l1+l2>l3) && (l1+l3>l2) && (l2+l3>l1)){
if (l1==l2==l3) {
document.getElementById('ris').innerHTML = "Triangolo equilatero";
}
else{
if ((l1!=l2) && (l1!=l3) && (l2!=l3)) {
document.getElementById('ris').innerHTML = "Triangolo Scaleno";
}
else{
document.getElementById('ris').innerHTML = "Triangolo Isoscele";
}
}
}
else{
alert("Le misure date non possono formare un triangolo !")
}
}
</script>
</head>
<body>
<input type="text" id="l1">
<br>
<br>
<input type="text" id="l2">
<br>
<br>
<input type="text" id="l3">
<br>
<br>
<input type="button" onclick="calcola()" value="Calcola">
<p id="ris"></p>
</body>
</html>