Answer on Question #37731, Programming, AJAX
Below is the code for simple html page with script you have asked. The actual code is between `<script></script>` tags we have marked it bold. We have binded the function to `document.onload` event, you are free to change event to any other.
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type"/>
<script>
window.onload = function() {
var weight = prompt('Enter your weight in pounds, please', 100);
if (weight >= 130 && weight <= 250) {
alert('You are allowed in the contest');
}
else {
alert('You are NOT allowed in the contest');
}
}
</script>
</head>
<body>
<div>TODO write content</div>
</body>
</html>
Comments