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

Sam Deering
Meet the author
Sam Deering is a Front-end Web Developer who specialises in JavaScript & jQuery. Sam is driven and passionate about sharing his knowledge to educate others.

Recommended

Learn Coding Online
Learn Web Development

Start learning web development and design for free with SitePoint Premium!

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