[jQuery] JQuery cloned elements new class isn't recognized.
Hey. I have two functions show after the message. The first works
fine. When a checkbox is clicked with the class availableProfile, its
class is removed, selectedProfile added. It is then appended to
anotehr list and destroyed in the original. However when i click the
now moved checkbox it doesn't recognize it has the new class of
selectedProfile.
$(".availableProfile").click(function(event) {
elementID = event.target.id;
elementGroup = elementID.split("__");
$(this).removeClass("availableProfile");
$(this).addClass("selectedProfile");
$(this).parent().clone(true).appendTo("#" + elementGroup[0] +
"_selected");
$(this).parent().remove();
});
$(".selectedProfile").click(function(event) {
elementID = event.target.id;
elementGroup = elementID.split("__");
$(this).removeClass("selectedProfile");
$(this).addClass("availableProfile");
$(this).parent().clone(true).appendTo("#" + elementGroup[0] +
"_available");
$(this).parent().remove();
});