码迷,mamicode.com
首页 > Web开发 > 详细

Jquery内容改变时触发事件

时间:2017-12-11 15:07:48      阅读:318      评论:0      收藏:0      [点我收藏+]

标签:func   function   cti   css   input   post   技术分享   es2017   bsp   

<div class="t_input">
        <label></label>
        <input type="text" name="" class="t_num" id="t_use">
        <span class="place_span">可提现金额:¥9,995.23</span>
</div>

 input里面的内容改变时span标签里的内容消失,input里面的内容为空时,当失去焦点后span标签显示

 

 

技术分享图片

 

<script type="text/javascript">
        $("#t_use").bind("input propertychange",function(){
            $(this).next(‘span‘).css("display",‘none‘);
        })
        $("#t_use").blur(function(){
            if($(this).val()==""){
                $(this).next(‘span‘).css("display",‘block‘)
            }
        })
</script>

 

Jquery内容改变时触发事件

标签:func   function   cti   css   input   post   技术分享   es2017   bsp   

原文地址:http://www.cnblogs.com/jvziking/p/8023032.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!