<tbody> <tr> <td style="width:25%">修改密码:</td> <td><input type="password" class="input" name="password" value="" id="password"></td> </tr> <tr> <td style="width:25%">确认密码:</td> <td><input type="password" class="input" name="password1" value="" id="password1"></td> </tr> </tbody>
<script> $(function(){ $(‘#button‘).click(function(){ var password=$(‘#password‘).val(); var password1=$(‘#password1‘).val(); if(password ==‘‘){ var flage=‘<font class="del" color="red">密码不能为空</font>‘; $(‘.del‘).remove(); $(‘#password‘).parent().append(flage); }else if(password.length<6){ var flage=‘<font class="del" color="red">密码长度不小于6位</font>‘; $(‘.del‘).remove(); $(‘#password‘).parent().append(flage); }else{ if(password1==password){ $(‘form‘).submit(); }else{ var flage=‘<font class="del" color="red">两次密码不一致</font>‘; $(‘.del‘).remove(); $(‘#password1‘).parent().append(flage); } } }); }) </script>
原文地址:https://www.cnblogs.com/mengor/p/8422578.html
时间: 2024-10-01 16:03:41