I want to build a JS script, to add 2 onClick events in 1 single button. This 2 events must works separately: ex. first click on button: event A
second click on the same button: event B
that's my code:
html button: press it once to how a div, press it again to show another div
<button id="add-form" class="add"><a class="btn" href="#"><i class="fa fa-plus-circle fa-2x"></i></a></button>-->
...
...
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script>
the 2 div are hidden at start
$("#div2").hide();
$("#div3").hide()
that's the function to(try) show the 2 divs, once at time
$("#add-form").click(function(){
$("#viaggio2").fadeIn();
}$("#add-form").click(function(){
("#viaggio3").fadeIn();
});
});
</script>
PS. Sorry for my bad english, and ty everyone who try to help me! :)