-
表单验证: <script type="text/javascript"> $("input:first").focusin("",function(e){ //e=event||window.event; $(this).val(e.data); }); $("input:first").focusout("请输入账号",function(ev){ //ev=event||window.event; $(this).val(ev.data); }) </script>查看全部
-
表单验证用的上: <script type="text/javascript"> $("input:first").focus("",function(e){ //e=event||window.event; $(this).val(e.data); }); $("input:first").blur("请输入账号",function(ev){ //ev=event||window.event; $(this).val(ev.data); }) </script>查看全部
-
mouseover() 和 mouseenter()有点抽象查看全部
-
用event 对象的which区别按键,敲击鼠标左键which的值是1,敲击鼠标中键which的值是2,敲击鼠标右键which的值是3查看全部
-
各个浏览器事件触发的顺序是不同的,一些浏览器在dblclick之前接受两个 click 事件 ,而一些浏览器只接受一个 click 事件。用户往往可通过不同的操作系统和浏览器配置双击灵敏度查看全部
-
表单事件用托管查看全部
-
//多事件绑定一 $("ul").on('click',function(e){ alert('触发的元素是内容是: ' + e.target.textContent) })查看全部
-
$('body').on('click','a', function(e) )事件委托,意思是只有点击a,body上的事件才会触发,避免冒泡查看全部
-
多个事件绑定同一个函数 $("#elem").on("mouseover mouseout",function(){ }); 通过空格分离,传递不同的事件名,可以同时绑定多个事件查看全部
-
多个事件绑定不同函数 $("#elem").on({ mouseover:function(){}, mouseout:function(){}, });查看全部
-
//监听input值的改变 $('.target1').change(function(e) { $("#result").html(e.target.value) }); //监听select: $(".target2").change(function(e) { $("#result").html(e.target.value) }) //监听textarea: $(".target3").change(function(e) { $("#result").html(e.target.value) })查看全部
-
focusout事件 $("input:last").focusout('**网', function(){ $(this).val('**网'); })查看全部
-
$("input:last").focusin( function(){ $(this).val('sb') }); 表单值用val,html和text都没用查看全部
-
表单事件聚焦 //不同函数传递数据 function fn(e) { $(this).val(e.data) } function a() { $("input:last").focusin('sb', fn) } a();查看全部
-
移近移出改变目标颜色 // hover()方法是同时绑定 mouseenter和 mouseleave事件。 // 我们可以用它来简单地应用在 鼠标在元素上行为 $("p").hover( function() { $(this).css("background", 'red'); }, function() { $(this).css("background", '#bbffaa'); } );查看全部
-
mouseenter阻止事件冒泡 var n = 0; $(".aaron2").mouseenter(function() { $(".aaron2 a:last").html('mouseenter冒泡事件触发次数:' + (++n)) })查看全部
举报
0/150
提交
取消