实时监听 input 输入框的值变化


摘:https://www.haorooms.com/post/jquery_on_drag

实时监听 input 输入框的值变化

//输入监听
$('#input').bind('input propertychange', function() {
       alert("我是实时监听哦")
});
//回车绑定
$("#input").keydown(function(event){ 
    if(event.which == "13")     
 //回车执行代码
});

select的监听

     $(document).ready(function(){
            $('select#select').change(function(){
               var checkvalue = $('#select').find("option:selected").val();
               alert(checkvalue);
            });
        });

 监听事件on写法解释

 

$(".haorooms").on("click",function(){
    alert("haorooms前端博客")
})
 
$(".haorooms").on({
    click:function(){
              alert("我是点击事件")
    },
    mouseover:function(){
        alert("mouseover");
    },
    mouseout:function(){
        alert("out")
    }
});

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM