Friday, October 7, 2011

focus(Function)

focus(Function fn) returns jQuery

Bind a function to the focus event of each matched element.

Example:

$("p").focus( function() { alert("Hello"); } );

HTML:
<p>Hello</p>

Result:
<p onfocus="alert('Hello');">Hello</p>

No comments:

Post a Comment