• support@answerspoint.com

Jquery focus out after pressing enter key

4376

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?

2Answer


0

Try this Code

$('.summaryT').keypress(function(e){
    if(e.which == 13){
        callajax();
        $(this).blur();    
    }
});
  • answered 8 years ago
  • B Butts

0

use the jquery blur() event


$('.summaryT').keypress(function(e){
    if(e.which == 13){
        callajax();
        $(this).blur();

    }
});

 

  • answered 8 years ago
  • G John

Your Answer

    Facebook Share        
       
  • asked 8 years ago
  • viewed 4376 times
  • active 8 years ago

Best Rated Questions