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
<tr>
<td id="status"><?php echo $row[PO_Status]; ?></td>
<td>
<center>
<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>
</button>
</a>
</center>
</td>
</tr>
<script>
$("#status").each(function() {
var status = $(this).text();
console.log(status);
});
if (status = 'reject'){
$("#edit").hide();
}
</script>
i have 4 td Approve,Approve,reject,reject when i check console it print Approve,Approve,Approve,Approve