Selectors in JQuery is used to select specific document objects like <body>, <h1>, <p>, <a> and many more. It’s use has made writing JQuery very easier and get the required DOM to have control over it.
Using Basic CSS Selectors
Any DOM element may have their unique ID or group of selctors may have a common class for styling. The ID selects unique element from the HTML DOM and class is applied for a wide selection. For eg.
<p id="myParagraph">This is the paragraph with ID attribute.<p><p class="ourParagraph">This is first the paragraph with Class attribute.</p><p class="ourParagraph">This is second paragraph with Class attribute.</p>
For accessing these ids and classes of paragraph it can be done as :-