Kwasi Denkyira

Kwasi Denkyira

  • 1.5k
  • 197
  • 14.8k

Get text from div inside td

Mar 22 2023 3:45 PM

I have a table with  mutiple  div tags inside a td tag and I want to get the text value of the div using jquery

<table class="table table-striped" style="width: 100%; table-layout: fixed;">
<thead>
   </thead>
    <tbody>
    <tr>
    <td>
    <div><b class="success">A</b></div>
    </td>
    </tr>
 <tr>
    <td>
    <div><b class="success">R</b></div>
    </td>
    </tr>
 <tr>
    <td>
    <div><b class="success">A</b></div>
    </td>
    </tr>
 <tr>
    <td>
    <div><b class="success">Denied</b></div>
    </td>
    </tr>
    </tbody>>
</table>

I want to do 

if(the div text == "A")
{
show all the tr with the div tags with "A" inside the td
}

Any help will be appreciated


Answers (4)