read tabel value using jquery

good morning i wanna try to hide an icon using jquery in table data, if table data value reject then icon hide. but it doesnt seem right

    <td id="status"><?php echo $row[PO_Status]; ?></td>
            <a id="edit" href="./page.php?page=editdatapo&id=<?php echo $row[id]; ?>">
               <button type="button" class="btn btn-default btn-sm">
                 <span class="glyphicon glyphicon-pencil"></span>
    $("#status").each(function() {
    var status = $(this).text();
if (status = 'reject'){

i have 4 td Approve,Approve,reject,reject when i check console it print Approve,Approve,Approve,Approve


As per HTML Standard you can give id only on time in a page, If there are 1 id multiple time then you have to use find.

$("tr").find("#status").each(function() {
    var status = $(this).html();
    if (status == 'reject'){

Leave a Reply

Your email address will not be published. Required fields are marked *