私のhtmlページにこのようなテーブルがあります
<table id="mytable">
<tr id="classified">
<td>1</td>
</tr>
<tr id="unclassified">
<td>0</td>
</tr>
</table>
したがって、document.readyで、値が0の列を確認したいのですが、値がoの場合は、その行を非表示にします。
私はこのコードを書きましたが、うまくいかないようです
$(document).ready(function IsValidTableContent() {
$('#mytable tr td').each(function () {
if ($(this).val() == 0) {
$(this).hide();
} else {
$(this).show();
}
});
});