在标签的事件属性字符串中编写程序,检查用户输入的密码明文

<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+' 密码:'+form1.password.value);" />
</form>
</body>

原文地址:https://www.cnblogs.com/clear93/p/4624297.html