jQuery Simple Method of Setting Text Box Enter Event

  • 2021-07-06 10:09:53
  • OfStack

In this paper, an example is given to explain the method of simply setting the carriage return event of the text box in jQuery. Share it for your reference, as follows:


$(document).ready(function () {
    $("#txt_JumpPager").keydown(function (e) {
      var curKey = e.which;
      if (curKey == 13) {
        $("#lbtn_JumpPager").click();
        return false;
      }
    });
});

Where txt_JumpPager is the text box ID and lbtn_JumpPager is the event button ID.

For more readers interested in jQuery related content, please check the topics of this site: "Summary of Usage and Skills of Common Events of jQuery", "Summary of Operation Skills of jQuery form", "Summary of Common Plug-ins and Usage of jQuery", "Summary of Data Skills of jQuery Operation of json", "Summary of Extension Skills of jQuery", "Summary of Operation Skills of jQuery Table (table)", "Summary of Common Classic Special Effects of jQuery", "Summary of Animation and Special Effects Usage of jQuery" and "Summary of Usage of jquery Selector"

I hope this article is helpful to everyone's jQuery programming.


Related articles: