jQuery Selector Examples


In this page, we will practice different jQuery selectors using simple examples.

These examples help strengthen understanding of how selectors work together.

Practicing selectors is very important because selectors are used in almost every jQuery program.

This example uses an ID selector to hide a specific button.

This example selects multiple elements using a class selector.

This example uses an attribute selector to clear all text input fields.

Selector Revision Summary:

  • #id selects unique elements
  • .class selects multiple elements
  • element selects by tag name
  • [attribute] selects by attribute
  • * selects all elements