Trying to remove functionality on an element
I'm trying to remove "functionality" on one of my elements.
This is the html/php that generates the code:
<table>
<?php for($i = 0; $i < 10; $i++){ ?>
<tr>
<?php for($k = 0; $k < 10; $k++) {?>
<td>asd</td>
<?php }?>
</tr>
<?php } ?>
</table>
And here is the jQuery:
$("td:not(done)").click(function(){
$(this).addClass("done");
if(blue){
$(this).css("background-color", "blue");
blue = false;
} else {
$(this).css("background-color", "red");
blue = true;
}
});
Trying to add a class to the td element that has been clicked so it does
not work after first click. But can't make it work.
No comments:
Post a Comment