Change tr background-color

后端 未结 7 1415
刺人心
刺人心 2021-02-04 04:36

I have something like this:

\' onclick=\"SetBackgroundColor(this)\" style=\"background-color:Yellow\">

Whe

7条回答
  •  [愿得一人]
    2021-02-04 05:03

    Instead of changing the table row background color, try changing the table cell background color.

    $(document).ready(function() {
        $(".mytr td").click(function() {
             $(this).css("background-color", "#000000");
        });
    });
    

提交回复
热议问题