What are the selectors in JQuery?
jQuery selectors are used to "find" (or select>
HTML elements based on their name, id, classes, types, attributes, values of attributes and lots more. It`s based on the existing CSS Selectors, and in addition, it has a few own custom selectors.
Every jQuery selector begin with thiis signal $(>
. This signal is called the factory function. It makes use of the 3 primary building blocks while choosing an detail in a given document.
Tag Name: It represents a tag call available in the DOM.
For example: $(`p'>
selects all paragraphs'p'in the document.
Tag ID: It represents a tag available with a selected ID withinside the DOM.
For example: $('#real-id'>
selects a specific element withinside the document that has an ID of real-id.
Tag Class: It represents a tag to be had with a specific class in the DOM.
For example: $('real-class'>
selects all elements in the document which have a class of real-class.
Try it here
<title> jQuery Example</title>
; </script> </head> <body> <p>techedhub.com.</p> </body> </html>