skip to Main Content

Jquery – search for text in classes using filter

I have this html: <td class="catName" data-bs-toggle="collapse" data-bs-target=".category1">A</td> <td class="catName" data-bs-toggle="collapse" data-bs-target=".category2">B</td> <td class="catName" data-bs-toggle="collapse" data-bs-target=".category3">C</td> I want to use the filter function to find the class that has the innerText "A". Trying with: jQuery(".catName").filter(item => jQuery(item).text() == "A"); But…

VIEW QUESTION
Back To Top
Search