How to traverse in jQuery using filtering methods?

$(selector) selects elements in the document that match the selector.

e.g.

$('p') selects all paragraphs in the document.
$('.my-class') selects all elements with the ‘my-class’ class attribute.

1 Like