Good afternoon I have the following doubt, as you will see I need that when the enter key is pressed I execute a function that I already have created.
If it detects the key and enters the function that I have created because it shows the alerts that I put inside it, but the problem is that the ajax code that I have inside that function is not executed because this is happening?
This is the code I'm using
$(document).ready(function(){
$("#dato").keypress(function(e) {
if(e.which == 13) {
obtenerDatos();
}
});
});
function obtenerDatos()
{
var valor = $("#dato").val();
$.ajax({
type: 'POST',
url: 'getDatos.php',
data: "valor=" + valor,
success: function(response){
$("#wrap").html(response);
}
});
}