On the click of button with class A, replace class A with class B. On the click of button with class B I need to perform an action.
It\'s applying/removing the class cor
Use a single event binding that handles both actions.
$(".changebut,.submitbut").click(function () {
if ($(this).is(".changebut")) {
$("input[type=text]").fadeOut("fast", function () {
$(".changebut").animate({
width: "100%"
}, 200).val("Submit again").removeClass("changebut").addClass("submitbut")
});
} else {
alert("It worked!");
}
});