$(function(){
            //输入框正在输入时
            $("#ipt").on('input',function(){
                if(!($('#ipt').val()=='')){
                    $(".cancle_ico").removeClass('hide');
                }else{
                    $(".cancle_ico").addClass('hide');
                }
            })

            //输入框得到焦点时
            $("#ipt").on('focus',function(){
                 if(!($('#ipt').val()=='')){
                    $(".cancle_ico").removeClass('hide');
                }else{
                    $(".cancle_ico").addClass('hide');
                }
            })

            //输入框失去焦点时
            $("#ipt").on('blur',function(){
                 if(($('#ipt').val()=='')){
                    $(".cancle_ico").addClass('hide');
                }else{
                    $(".cancle_ico").removeClass('hide');
                }
            })
})        

 

相关文章:

  • 2022-12-23
  • 2021-07-18
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-11-30
  • 2022-02-11
  • 2022-03-09
  • 2022-12-23
  • 2022-12-23
  • 2021-05-02
相关资源
相似解决方案