jquery on key up code example

Example 1: jquery on enter key pressed

//jQuery detect user pressing enter
$(document).on('keypress',function(e) {
    if(e.which == 13) {
        alert('User pressed Enter!');
    }
});

Example 2: check when keyup an input from a specific form jquery

var inputs = $('#formID').find('input[type="text"]');
inputs.keyup(function() {
   console.log($(this));
});

Example 3: jquery keyup

// Similar to KeyUp but just called on input change (optimal for AJAX calls)
  var input = $('#formID').find('input[type="text"]');
  input.on('input',
    function(){
      console.log (input.val());
    });