<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>New Web Project</title> </head> <body> <form id="form1" name="form1" method="post" action=""> <label>姓名: <input type="text" name="textfield1" /> </label> <p> <label>密码: <input type="password" id="password" name="textfield2" /> </label> </p> <input type="submit" name="Submit" value="查看密码和姓名" onclick="javascript:alert('姓名:'+form1.textfield1.value +'\n密码:'+form1.textfield2.value);" /> </form> </body> </html>