jQuery API | jQuery API 中英文对照版 - jQuery在线查询手册 |
focus(fn) |
focus(fn)
在每一个匹配元素的focus事件中绑定一个处理函数。 返回值:jQuery 参数:
示例: $("p").focus( function() { alert("Hello"); } ); HTML 代码: <p>Hello</p> 结果: <p onfocus="alert('Hello');">Hello</p> Bind a function to the focus event of each matched element. Return value: jQueryParameters:
Example: $("p").focus( function() { alert("Hello"); } );Before: <p>Hello</p>Result: <p onfocus="alert('Hello');">Hello</p>
|