Мне просто интересно, почему эта простая функция не работает. Я просмотрел все, и все же я получаю ошибки. Я просто хочу посмотреть, способен ли человек ездить на американских горках. Минимальная высота равна 64. Таким образом, допустимо любое равное или большее. Любая помощь будет принята с благодарностью.Простые функции javascript
<!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>
Какие ошибки вы получаете? – Sionnach733
if (ht> = 64). Вы хотите сказать, если ht больше или равно, не меньше. –
Возможно, вы захотите этого: 'alert (« Вы можете ехать! »);' –