Selectors are useful to get a reference to a particular element or group of elements satisfying some condition.
In DOM these elements can be filtered by tag name, class, id, attribute or a combination of all these.
The below example shows selecting elements based on TAG name. Here we have
added a click event to all 'paragraph' elements and modified the inner HTML of
all anchor tags. $(this) holds a reference to the element being referenced in the current context.