在标签的事件属性字符串中编写程序,检查用户输入的密码明文<body> <form action="" id="form1" name="form1" method="post"> <label>姓名: <input type="text" name="textfield" /> </label> <p> <label>密码: <input type="passWord" id="password" name="textfield2" /> </label> </p> <input type="submit" name="Submit" value="查看密码和姓名" onclick="javascript:alert('姓名:'+form1.textfield.value+'\n 密码:'+form1.password.value);" /> </form></body>