For some reason the toggleClass function does not seem to be working.
I have a table row with a class "nodrag" - being used with tableDnD plugin:
<tr id="1" class="nodrag">
<!--Some tds and stuff-->
</tr>
When I click a link I want to toggle the class on and off with the following code which is in the $(document).ready function:
$("#reorder").click(function(event) {
$("#1").toggleClass("nodrag");
if ($(this).text()=='Reorder')
{
$(this).text("Done reordering");
} else {
$(this).text("Reorder");
}
event.preventDefault();
});
I know the click event fires because the text of the link changes. I also know the selection of the row works because if I do something else with it like - $("#1").text("test") - that works.
It just seems to a problem with toggleClass. I've searched everywhere though and found nothing that helps me.
Thanks in advance for any help