fn | Function | A function to bind to the keydown event on each of the matched elements. |
---|
Bind a function to the keydown event of each matched element.
<p>Hello</p>
$("p").keydown( function() { alert("Hello"); } );
<p onkeydown="alert('Hello');">Hello</p>
Trigger the keydown event of each matched element. This causes all of the functions that have been bound to thet keydown event to be executed.
<p onkeydown="alert('Hello');">Hello</p>
$("p").keydown();
alert('Hello');
fn | Function | A function to bind to the keydown event on each of the matched elements. |
---|
Bind a function to the keydown event of each matched element, which will only be executed once. Unlike a call to the normal .keydown() method, calling .onekeydown() causes the bound function to be only executed the first time it is triggered, and never again (unless it is re-bound).
<p onkeydown="alert('Hello');">Hello</p>
$("p").onekeydown( function() { alert("Hello"); } );
alert('Hello'); // Only executed for the first keydown
fn | Function | A function to unbind from the keydown event on each of the matched elements. |
---|
Removes a bound keydown event from each of the matched elements. You must pass the identical function that was used in the original bind method.
<p onkeydown="myFunction">Hello</p>
$("p").unkeydown( myFunction );
<p>Hello</p>
Removes all bound keydown events from each of the matched elements.
<p onkeydown="alert('Hello');">Hello</p>
$("p").unkeydown();
<p>Hello</p>
fn | Function | A function to bind to the keypress event on each of the matched elements. |
---|
Bind a function to the keypress event of each matched element.
<p>Hello</p>
$("p").keypress( function() { alert("Hello"); } );
<p onkeypress="alert('Hello');">Hello</p>
Trigger the keypress event of each matched element. This causes all of the functions that have been bound to thet keypress event to be executed.
<p onkeypress="alert('Hello');">Hello</p>
$("p").keypress();
alert('Hello');
fn | Function | A function to bind to the keypress event on each of the matched elements. |
---|
Bind a function to the keypress event of each matched element, which will only be executed once. Unlike a call to the normal .keypress() method, calling .onekeypress() causes the bound function to be only executed the first time it is triggered, and never again (unless it is re-bound).
<p onkeypress="alert('Hello');">Hello</p>
$("p").onekeypress( function() { alert("Hello"); } );
alert('Hello'); // Only executed for the first keypress
fn | Function | A function to unbind from the keypress event on each of the matched elements. |
---|
Removes a bound keypress event from each of the matched elements. You must pass the identical function that was used in the original bind method.
<p onkeypress="myFunction">Hello</p>
$("p").unkeypress( myFunction );
<p>Hello</p>
Removes all bound keypress events from each of the matched elements.
<p onkeypress="alert('Hello');">Hello</p>
$("p").unkeypress();
<p>Hello</p>
fn | Function | A function to bind to the keyup event on each of the matched elements. |
---|
Bind a function to the keyup event of each matched element.
<p>Hello</p>
$("p").keyup( function() { alert("Hello"); } );
<p onkeyup="alert('Hello');">Hello</p>
Trigger the keyup event of each matched element. This causes all of the functions that have been bound to thet keyup event to be executed.
<p onkeyup="alert('Hello');">Hello</p>
$("p").keyup();
alert('Hello');
fn | Function | A function to bind to the keyup event on each of the matched elements. |
---|
Bind a function to the keyup event of each matched element, which will only be executed once. Unlike a call to the normal .keyup() method, calling .onekeyup() causes the bound function to be only executed the first time it is triggered, and never again (unless it is re-bound).
<p onkeyup="alert('Hello');">Hello</p>
$("p").onekeyup( function() { alert("Hello"); } );
alert('Hello'); // Only executed for the first keyup
fn | Function | A function to unbind from the keyup event on each of the matched elements. |
---|
Removes a bound keyup event from each of the matched elements. You must pass the identical function that was used in the original bind method.
<p onkeyup="myFunction">Hello</p>
$("p").unkeyup( myFunction );
<p>Hello</p>
Removes all bound keyup events from each of the matched elements.
<p onkeyup="alert('Hello');">Hello</p>
$("p").unkeyup();
<p>Hello</p>