【发布时间】:2017-03-17 11:02:55
【问题描述】:
<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
我使用 for each 循环显示结果,因此状态值会发生变化,我想根据值更改颜色,例如如果状态 == 1,则类的颜色为红色,当它为 2 时颜色更改变绿
【问题讨论】:
-
你能用html表结构粘贴一个jsfiddle吗?
-
$(this) 中有什么对象存储?
标签: jquery html css asp.net-mvc