Jquery focus out after pressing enter key
My code is below:
$('.summaryT').keypress(function(e){
if(e.which == 13){
callmyFunction();
$(this).focusout();
}
});
As you can see on the code above, When a user presses the enter key first callmyFunction();()
is run(working fine). After that I want to focus out from the .summaryT
input box, How can I achieve this?
CSS
html
Javascript
jQuery
PHP
- asked 9 years ago
- Gul Hafiz
2Answer
Try this Code
$('.summaryT').keypress(function(e){
if(e.which == 13){
callajax();
$(this).blur();
}
});
- answered 9 years ago
- B Butts
use the jquery blur() event
$('.summaryT').keypress(function(e){
if(e.which == 13){
callajax();
$(this).blur();
}
});
- answered 9 years ago
- G John
Your Answer