I am not sure what I am doing wrong, I need to read a variable from an input form (HTML), and, return its absolute value:

home.html
<html>
<head>
<title>Home page </title>
</head>
<body>
The brown fox jumps over the red wooden tree
<script>
function abs(x)
{
if (x >=0) {return x;]
else {return -x;}
}
</script>
<% number age = 0 %;>
<form>
First name: <input type="text" name="firstname"><br>
Last name: <input type="text" name="lastname">
Age: <input type="number" name="What is your age?" value="<%=age%>">
</form>
<button type="button" onclick="abs(age)">What's my age again?</button>
</body>
</html>

HTML
JavaScript