$(function(){ $(".signin-form").validate({ submitHandler:(form) => { jpalert($(".signin_success").val(),"../lanhu/index.html") } }); $(".form-control").on("input",function(evn){ //console.log('input'); let $icon=$(this).siblings('.input-tool-icon'); if($(this).val().length>0){ $icon.show(); } else{ $icon.hide(); } }); $(".form-group-custom").on("click",".glyphicon-remove",function(evn){ $(this).siblings('.form-control').val(''); $(this).hide(); }); $(".form-group-custom").on("click",".glyphicon-eye-open",function(evn){ $(this).siblings('.form-control').prop('type','text'); $(this).removeClass('glyphicon-eye-open'); $(this).addClass('glyphicon-eye-close'); }); $(".form-group-custom").on("click",".glyphicon-eye-close",function(evn){ $(this).siblings('.form-control').prop('type','password'); $(this).removeClass('glyphicon-eye-close'); $(this).addClass('glyphicon-eye-open'); }); });