发布时间:2021-02-08 点击:6
jQuery focus() 方法是当表单元素获得焦点时会触发focus事件,或者规定当发生focus事件时触发。
$(selector).focus(function)
其中:
selector是jQuery的选择器;
function是jQuery focus触发后调用的方法;
$("input").focus(function(){ alert("输入框获得了焦点"); });
上一篇:jQuery change() 方法
下一篇:jQuery blur() 方法
服务器2021-02-15
服务器2021-02-14
jQuery2021-02-13
jQuery2021-02-12
jQuery2021-02-11
jQuery2021-02-10