The #id Selector – jQuery Tutorial


The #id Selector


The jQuery #id selector uses id attribute of HTML tag to find the specific element.
An id should be unique within the page so you should use the #id selector when want to find the single and unique element.
To find the element with the specific id, write the hash character followed by the id of the HTML element:



In this example when a user clicks on the button the element with id=”test” will be hidden:


Try It Yourself - Online Compliler >>