![](/img/trans.png)
[英]Add class on click and remove when clicked again to that particular tr or span
[英]Add class to table row when glyphicon is clicked and remove when clicked again
我可以在glyphicon单击上添加一个类,但不能将其删除。 这是我的小提琴
以下是我的jQuery。 我想添加一个if语句if hasClass then remove else addClass "success"
jQuery(function($){
$("tbody").on("click",".questCompletion > .glyphicon-ok", function(){
$(this).parents("tr").addClass("success");
});
});
jQuery(function($){
$("tbody").on("click",".questCompletion > .glyphicon-ok", function(){
$(this).parents("tr").toggleClass("success");
});
});
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.