Skip to content

Instantly share code, notes, and snippets.

@tsevdos
Created January 2, 2012 09:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tsevdos/1550043 to your computer and use it in GitHub Desktop.
Save tsevdos/1550043 to your computer and use it in GitHub Desktop.
jQuery tips: Chaining
$('<div id="test"><p><a>John</a></p></div>').find('a').attr('href' , 'http://phrappe.com/').end().appendTo('body');
$('<div id="test"><p><a>John</a></p></div>')
.find('a')
.attr('href' , 'http://phrappe.com/')
.end()
.appendTo('body');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment