<html> <head> <title>内容赋值</title> </head> <body> <script language="javascript"> <!-- function showtxt(){ objtxt = document.form1.txt; alert("你输入的内容为: " + objtxt.value); } //--> </script> <form name="form1"> <input type="text" name="txt"> <input type="button" value ="显示" onClick="showtxt()"> </form> </body> </html>