jquery td 点击改变颜色

来源:互联网 发布:备案域名到期查询 编辑:程序博客网 时间:2024/03/28 18:48
$('#timetable td').each(function(){            $(this).click(function(){                if($(this).html()=="√"){                    $(this).css("background-color","white");                    $(this).text("");                }else {                    $(this).css("background-color", "#96b8ff");//设置点击td的颜色                    $(this).text("√");                }            });        });
0 0