I made this prank webpage... but when I click the button nothing happens, and when I look in the Error Console in Firefox, it says "document.txtbox is undefined." Any help?
err...
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Strict//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>
Find your match here!
</title>
<script language="JavaScript" type="text/javascript">
function FindMatch() {
alert("Your perfect match has been found, " + this.name);
document.matchimage.src =
"http://naturalpatriot.org/wp-content/uploads/2008/12/tall-hamburger.jpg";
}
function Match(name) {
this.name = name;
this.FindMatch = FindMatch;
}
</script>
</head>
<body>
<img name="matchimg" />
<br />Enter your name here!
<input type="text" name="txtbox" size="20" />
<input type="button" name="btn" value="Find your match!"
onClick="user = new Match(document.txtbox.value); user.FindMatch();" />
</body>
</html>
err...