<tr class="acti">//class
<script type="text/javascript">
var status = $(this).parent().parent().children(".activity-status").attr("data-value");//Jquery value according to which the colour of the upper class is going to be changed
Iam为每个循环使用a显示结果,因此状态值变化,我想根据值更改颜色,例如,如果status == 1那么类的颜色是红色,当它是2颜色变化时绿色
答案 0 :(得分:0)
我们走了:
var status = $(this).parent().parent().children(".activity-status").attr("data-value");
if(status == 1){
$("tr").css("color","yourcolor");
}
else if(status == 2){
$("tr").css("color","anothercolor");
}