jQuery basically have following type of events:
Example:
$(document).ready(function() {
// Handler for .ready() called.
});
Triggers event when page is fully loaded with all control:
// Add code here
});
You may call if any element on page is loaded
<img src="something.png" id="imageDemo" />
$("#imageDemo").load()(function() {
// Add code here.
});
Example:
$(window).unload(function() {
alert('I am unloading.');
});
so for textbox you can write it like:
<input id="keyDownDemo" type="text" value="Hello" />
$('#keyDownDemo).keydown(function() {
alert(Hello jQuery KeyDown Happened.');
});
so for textbox you can write it like:
<input id="keyUpDemo" type="text" value="Hello" />
$('#keyUpDemo).keyup(function() {
alert(Hello jQuery KeyUp happened.');
});
so for textbox you can write it like:
<input id="keyPressDemo" type="text" value="Hello" />
$('#keyPressDemo).keypress(function() {
alert(Hello jQuery KeyPress happened.');
});