If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

Main content

Project: DOM detective

The Khan Academy website includes jQuery, so you can actually open your JavaScript console right now and successfully run this line of code to show you the inner text of all the <h1> elements on this page:
$("h1").text();
Want to know how many <h1> elements there are? Run this line of code:
$("h1").length;
Now, try to use CSS selectors to find more elements of this Khan Academy page, like:
  • All the links.
  • This article.
  • Every image.
  • The sidebar navigation.
  • Your name in the upper right corner.
  • The text that says 'Home'.
  • ...keep going!
You're welcome to share your selectors in the discussion below, but keep in mind that our HTML constantly changes, so the selectors that once worked might not keep working forever. Also, there are often multiple CSS selectors that can find the same element, so there are lots of right answers out there.
Now get on your detective hat and start sleuthing around our DOM!

Want to join the conversation?