jQuery Full List of Events You Can Bind To
As you may already know, there are quite a few mouse events, keyboard events, browser events, DOM element events etc that you can capture with JavaScript and then use some jQuery to perform actions based on the event fired using bind(), live() or such. Here is a list of the main events which you should be aware of.
blur, focus, focusin, focusout, load, resize, scroll, unload, click, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, error
Mouse Events
scroll, click, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, load, resize, scroll, unload, error,
Example Usage
(function($)
{
$(document).ready(function()
{
$('#id).bind('click', function(e)
{
//mouse event fired (element clicked)
});
});
})(jQuery);
Keyboard Events
keydown, keypress, keyup
Example Usage
(function($)
{
$(document).ready(function()
{
$(document).bind('keypress', function(e)
{
//keyboard event fired
});
});
})(jQuery);
Browser Events
load, resize, scroll, unload, error
Example Usage
(function($)
{
$(document).ready(function()
{
//browser event fired (document object model loaded)
});
})(jQuery);
DOM Element Events
blur, focus, focusin, focusout, change, select, submit
Example Usage
(function($)
{
$(document).ready(function()
{
$('#id).bind('blur', function(e)
{
//dom event fired (input focus)
});
});
})(jQuery);