Reference your tags in document : Tag Reference « Document « JavaScript Tutorial






<HTML>

<HEAD>

<SCRIPT language="JavaScript">
<!--
function newpage()
{
 var thename= document.myform.yourname.value;
 var thefood= document.myform.yourfood.value;
 document.open();
 document.write("Your name is "+thename);
 document.write("<BR>");
 document.write("Your favorite food is "+thefood);
 document.close();
}
//-->
</SCRIPT>

</HEAD>

<BODY>

<FORM name="myform">
Name: <INPUT type="text" name="yourname" size="25">
<P>
Favorite Food: <INPUT type="text" name="yourfood" size="25">
<P>
<INPUT TYPE="button" value="Click Here for a New Page" onClick="newpage()">
</FORM>

</BODY>

</HTML>








14.33.Tag Reference
14.33.1.Reference your tags in document
14.33.2.Get form TextField value