Mark Pearl

General

$('div'.addClass('foo');

This adds a css class to all the div tags on the page.

$(document).ready(function() {
	$('button#myButton').click(function() {
		alert('Button was clicked');
	});
});  

Unobtrusive JavaScript

Unobtrusive javascript is the process of keeping the site’s markup separate from its behavior (code).

References

The Mother Ship - JQuery



blog comments powered by Disqus

Want to get my personal insights on what I learn as I learn it? Subscribe now!


/