I have the following function in jquery
in my script PHP
$('.myinput').on('blur', function(e) {
$.ajax({
url: 'gravadado.php',
method: 'POST', // ou POST
data: {
q10600: this.value
},
success: function(resposta) {
var div = document.querySelector('#divDestino');
div.innerHTML = resposta;
}
});
});
I have several inputs with the same class (.myinput) but in my jquery
where I pass the name statically I want to pass the name of the input that called the event.
That is, if it was the input
with name q10630 that triggered the event Onblur
of Jquery
I want to pass on my function Jquery
the name q10630 but if it is the name of the input q10700 that triggered the event I'm going to pass this name 'q10700'.
I do not know if it was very confusing. And I do not know if this is possible either way.
Or if I have to give a class name for each input I have and create an event for each of these Onblur
classes separately?!?
Because I actually have many inputs in my code HTML
. Then you would get hundreds of onblur
events if you have to reference each Input with a different class name. Do you understand?