TOP
EL EN
Selectors - Class name selector
15 September 2024 Published by Aristotelis Pitaridis
Tools used for this tutorial
jQuery 3.7.1
SHARE

The following example demonstrates how to select all elements which have the myClass class name.

var elements = $('.myClass');

We can also fine all the elements by tag name which have a specific class name. The following example selects all the <a> elements which have the class name myClass.

var elements = $('a.myClass');