My code is below:
$('.summaryT').keypress(function(e){
if(e.which == 13){
callajax();
$(this).focusout();
}
});
As you can see on the code above, When a user presses the enter key first callajax()
is run(working fine). After that I want to focus out from the .summaryT
input box, How can I achieve this?
Try this
$('.summaryT').keypress(function(e){
if(e.which == 13){
callajax();
$(this).blur();
}
});
Since AJAX stands for asynchronous, you may want to call focusout()
after the call successfully finished.
use the jquery blur() event
$('.summaryT').keypress(function(e){
if(e.which == 13){
callajax();
$(this).blur();
}
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With