I am trying to add a class to textarea on keyup event . The event is firing but the class is not getting added . Here I am trying to add the class if it doesn’t exist to that textarea instance
$("textarea").live("keyup", function() {
$("this[class='']").addClass("modified");
});
During submit , I am using the below code to disable the ones which doesn’t have class modified . But this is not submitting any textareas . So looks like no class is being added in the above code .
$("textarea:not(.modified)").attr("disabled", "disabled");
Could some one help me what the problem with this code?
Thanks
Regards
Kiran
It should be
The class will not be added if it is present already.