lundi 9 juillet 2018

jQuery Why on-change fucntion doesn't work for 2 or more

I use .on("change", function(){} and .click(function(){} for button to hide and show some objects.

But if I try it for more than one , it simply doesn't work.

Does anybody know why?

Code:

$('#radioid1').on("change", function(){
$("#button1").click(function(){
    $("#object1").hide();
    $("#object2").show();
    $("#button1").hide();
});

$('#radioid2').on("change", function(){
$("#button1").click(function(){
    $("#object1").hide();
    $("#object3").show();
    $("#button1").hide();
});




Aucun commentaire:

Enregistrer un commentaire