im setting css style to next element using jquery…
i want set css style to next .comment by click on .show_cmt class but
it wont work.
<script>
var cmt = true;
$(document).on('click','.show_cmt',function(e){
if(cmt == true){
$(this).next('.comment').animate({backgroundColor: 'red'},500);
cmt = false;
}
else
{
$(this).next('.comment').animate({backgroundColor: 'black'},500);
cmt = true;
}
})
</script>