怎么找到指定颜色的td表格
----
$("#hutNew").find("td").each(function () { if ($(this).attr('style') == 'background:rgb(34, 139, 34)') { $(this).css({ "width": "140px", "cursor": "pointer" }); } else if ($(this).attr('style') == 'background:none') { $(this).css("background", "rgb(85, 85, 85)"); } });
定义cssclass用class来找
定义cssclass用class来找
具体说一下
.backcolor{background:rgb(34, 139, 34)}
if($(this).attr('class')=="backcolor"){//}
.backcolor{background:rgb(34, 139, 34)}
if($(this).attr('class')=="backcolor"){//}
.backcolor{background:rgb(34, 139, 34)}
if($(this).attr('class')=="backcolor"){//}
.backcolor{background:rgb(34, 139, 34)}
if($(this).attr('class')=="backcolor"){//}