jQuery Selectors are used to find out matching elements and select one or more HTML elements using jQuery and then perform operations on them.
Factory function is a synonym of jQuery() function start with the dollar sign and parentheses $()
The following three tags are used by $() for selecting elements
1. Tag Name:-
It represents a tag name present in your DOM.
$('h2') selects all paragraphs <h2> in the document.
2. Tag ID:-
It represents a tag with the defined ID in your DOM.
$('#some-id') selects the single element in the document that has an ID of some-id.
Tag class is very similiar to tag id it also represents a tag with the defined class in your DOM.but it selects all elements in the documents whereas tag id selects only a single element in the document.
$('.some-class') selects all elements in the document that have a class of some-class.
See this example to understand the use of selectors.
Here in this example all the elements with a tag name p will be selected with font-size 15px and background red.
<title>The jQuery Example</title>
src = "http://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js">
<p class = "myclass">This is a paragraph.</p>
<p id = "myid">This is second paragraph.</p>
<p>This is third paragraph.</p>