Greatest among any three numbers using JavaScript

<html>
<head>
<script>
function largestnum()
{
var num1, num2, num3;
num1 = Number(document.getElementById("F").value);
num2 = Number(document.getElementById("S").value);
num3 = Number(document.getElementById("T").value);
if(num1>num2 && num1>num3)
{
alert(num1+"-is greatest");
}
else if(num2>num1 && num2>num3)
{
alert(num2+"-is greatest");
}
else if(num3>num1 && num3>num1)
{
alert(num3+"is greatest");
}
}
</script>
</head>
<body>
<h1>Check largest number </h1>
<br>
Enter number 1: <input id="F"></input><br>
Enter number 2: <input id="S"></input><br>
Enter number 3: <input id="T"></input><br>
<button onclick="largestnum()">submit</button>
</body>
</html>