public
Description: Data Binding Plugin for jQuery
Home | Edit | New

Demo: Event Binding

Demos > Event Binding

Click one of the items.

First Last

Source

<div id="persons">
	<div class="item"><span class="first">First</span> <span class="last">Last</span></div>
</div>
$('#persons')
	.items([
		{first:'Isaac', last:'Newton'},
		{first:'Johannes', last:'Keppler'},
		{first:'Alessandro', last:'Volta'},
		{first:'Blaise', last:'Pascal'}
	])
	.chain(function(){
		var self = this;
		this.click(function(){
			var data = self.item();
			alert(data.last+', '+data.first);
		})
	});
Last edited by raid-ox, Sat Aug 16 06:11:54 -0700 2008
Home | Edit | New
Versions: