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

<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>

posted @ 2015-07-06 14:29  程序猿凯  阅读(248)  评论(0编辑  收藏  举报