1
I created this code and I’m trying to do the reverse function, IE, if it’s closed, open, if it’s open close. I’m having problems and I don’t see anything on the console. Can you help me?
/////////////////////////////////////////////
$("#edit_prod").on("click", function(event) {
event.preventDefault();
////////////////////////////////
var code = $(this).data("forms");
$(".formsEditProdutos").addClass("esconde");
$(".formsEditProdutos").attr("id", code).removeClass("esconde");
}, function(event){
var code = $(this).data("forms");
$(".formsEditProdutos").attr("id", code).addClass("esconde");
});
The
click
does not accept two functions. I see that you are changing the ID every click, it seems strange, I think there are better ways to do that... You can explain what you want to do?– Sergio
You can put the HTML of this
#edit_prod
and of.formsEditProdutos
? Then I can give you a suggestion as to how best to do it.– Sergio