I'm trying to get the value of an input, I do not want to use a button and I want to get the value when I stop selecting the text box in which the data is being entered, any idea of how to start ?? / p>
I'm trying to get the value of an input, I do not want to use a button and I want to get the value when I stop selecting the text box in which the data is being entered, any idea of how to start ?? / p>
You can use the function blur
of jquery, basically this function is used when the "focus" of an element is removed. Example:
$( "#input" ).blur(function() {
alert( "Se ha quitado el foco del elemento");
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
Has clic en el input y luego en un espacio en blanco:
<input id="input" type="text"/>
It will only work if the input already has a value when loading the page
$(document).ready(function(){
cedula = $("#iddelinput").val();
alert(cedula);
)}