Jquery改变td内容为1的颜色
<
table id="tb" > <tr> <td val="1">1</td> </tr> <tr> <td val="0">0</td> </tr> </table> <script> $(function () { $.each($("#tb").find("tr td"), function (v, t) { var tdVal = $(this).attr("val"); if (tdVal == "1") { $(this).css("background", "red"); } }); }); </script>

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-16
  • 2021-07-30
  • 2021-12-21
猜你喜欢
  • 2022-12-23
  • 2022-01-22
  • 2022-12-23
  • 2021-10-19
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案