jQuery element selector based on classname

$('.myclass')

selects all elements that have a class of myclass

$('p.myclass')

selects all paragraphs that have a class of myclass

$('.myclass.otherclass')

selects all elements that have a class of myclass and otherclass

Enjoyed this post? Share it!

 

Leave a comment

Your email address will not be published.