jQuery selector for element ID

$('#myid')

selects the unique element with id=’myid’, regardless of its tag name

$('p#myid')

selects a single paragraph with an id of ‘myid’; in other words, the unique element

<p id='myid'>

Enjoyed this post? Share it!

 

Leave a comment

Your email address will not be published.