JavaScript
Article

jQuery Full List of Events You Can Bind To

By Sam Deering

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);

Demo

See: Find the Keycode of Keyboard Key Pressed

Free Guide:

7 Habits of Successful CTOs

"What makes a great CTO?" Engineering skills? Business savvy? An innate tendency to channel a mythical creature (ahem, unicorn)? All of the above? Discover the top traits of the most successful CTOs in this free guide.

Recommended
Sponsors
Because We Like You
Free Ebooks!

Grab SitePoint's top 10 web dev and design ebooks, completely free!

Get the latest in JavaScript, once a week, for free.