Friday, October 7, 2011

keypress(Function)

keypress(Function fn) returns jQuery

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

Example:

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

HTML:
<p>Hello</p>

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

No comments:

Post a Comment