How to recognize button / element click within a modal window?
I tried the following without success:
$("#modalEscolha").bind('click', function () {
if ($("#escolherComp").data('clicked')) {
alert("Componente!");
} else if ($('#escolherKIT').data('clicked')) {
alert("KIT!");
} else {
$('#acionamento').prop('selectedIndex', 0);
}
});
Editing :
I have a input select
, which must be set according to modal closure or with the click of the buttons: escolherComp
or escolherKIT
. If the user closes the modal, or clicking outside the body, or the close button, the index 0
must be set, otherwise, if any click occurs, the set option should remain (no action is executed).