How do you perform a basic filtering operation on jQuery elements?
Description : Use the .filter() method to select elements that match a specified condition.
Answer :
To perform a basic filtering operation on jQuery elements, use the `.filter()` method. This method allows you to select elements that meet a certain condition. For example,`$('li').filter('.active')` selects only the `<li>` elements that have the class`active`. You can also use a functionas a filter criterion, such as`$('li').filter(function() { return $(this).text() === 'Item 1'; });`, which selects `<li>` elements whose text content equals 'Item 1'.