I am just curious why this simple function is not working. I have looked over everything and still I am getting errors. I just want to see if the person is able to ride the roller coaster. The min height is 64. So anything equal or greater is allowed. Any help would be greatly appreciated.
<!doctype>
<html>
<head>
<meta charset="utf-8">
<title>Are you tall enough</title>
<script type="text/javascript">
function ride(){
var rideMin = 64;
var ht = document.getElementById("height")[0].value;
if( ht <= 64){
prompt(You may go on the ride!!);
}
}
</script>
<style>
.container{
width: 960px;
}
input{
width:250px;
height: 150px;
margin-left: 375px;
}
img{
margin-left: 300px;
max-width: 100%;
width: 40%;
margin-bottom: 100px;
}
h1{
margin-left: 200px;
margin-bottom: 50px;
color: blue;
}
</style>
</head>
<body>
<div class="container">
<h1> Are you tall enough to ride the roller coaster</h1>
<img src="roller.png">
<div class="height">
<input type="text" id="height" placeholder="Please enter your height">
<input type="submit" value="sumbit" onclick=ride()>
</div>
</div>
alert("You may go on the ride!!");