Created
January 2, 2012 09:26
-
-
Save tsevdos/1550020 to your computer and use it in GitHub Desktop.
jQuery tips: Specify a context
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('h1', 'div#posts'); //using jQuery wrapper as context |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('h1', 'body'); // using an expression | |
$('input', document.form[0]); // using a DOM reference |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('h1', 'div#posts'); //using jQuery wrapper as context |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('h1', 'body'); // using an expression | |
$('input', document.form[0]); // using a DOM reference |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment