Will someone please help me with this code. The user is suppose to type in a sport in the textbox and it is suppose to alert the user where they play the sport. I would greatly appreciate it!!!
Thanks
Lmarshall
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Sports.html</title>
<SCRIPT LANGUAGE= "JavaScript1.2">
<!-- HIDE FROM INCOMPATIBLE BROWSERS
function sport_Name(sport) {
var sport= "";
switch (sport) {
case "golf":
alert("Golf is played on a golf course."
break;
case "tennis":
alert ("Tennis is played on a tennis court."
break;
case "baseball":
alert("Baseball is played on a baseball diamond."
break;
case "basketball":
alert ("Basketball is played on a basketball court."
break;
}
}
</SCRIPT>
</head>
<body>
<FORM NAME="TYPES">
What sport do you want to look up? <INPUT TYPE="TEXT" NAME="sport" SIZE="25"> <BR>
<INPUT TYPE="button" VALUE="Look up what they play on" onClick="sport_Name();">
</FORM>
</body>
</html>
Thanks
Lmarshall
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Sports.html</title>
<SCRIPT LANGUAGE= "JavaScript1.2">
<!-- HIDE FROM INCOMPATIBLE BROWSERS
function sport_Name(sport) {
var sport= "";
switch (sport) {
case "golf":
alert("Golf is played on a golf course."
break;
case "tennis":
alert ("Tennis is played on a tennis court."
break;
case "baseball":
alert("Baseball is played on a baseball diamond."
break;
case "basketball":
alert ("Basketball is played on a basketball court."
break;
}
}
</SCRIPT>
</head>
<body>
<FORM NAME="TYPES">
What sport do you want to look up? <INPUT TYPE="TEXT" NAME="sport" SIZE="25"> <BR>
<INPUT TYPE="button" VALUE="Look up what they play on" onClick="sport_Name();">
</FORM>
</body>
</html>