Created
December 23, 2012 22:41
-
-
Save jbail/4366493 to your computer and use it in GitHub Desktop.
querySelector and querySelectorAll
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
var article = document.getElementById('article'); | |
var p = article.querySelector('p'); //returns the first 'p' tag that's a child of the #article element | |
p = article.querySelectorAll('p'); //returns a NodeList containing all 'p' tags that are children of the #article element |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment