Skip to content

Instantly share code, notes, and snippets.

@Bewitchedyegor
Created October 12, 2017 13:35
Show Gist options
  • Save Bewitchedyegor/c6649d02696352407a8b9e38a8395a5b to your computer and use it in GitHub Desktop.
Save Bewitchedyegor/c6649d02696352407a8b9e38a8395a5b to your computer and use it in GitHub Desktop.
Change number inside input if maximum/minimum value is reached
$('#pickAgeStart').on('keyup keydown click change', function(e) {
if ($(this).val() > 65 && e.keyCode !== 46 && e.keyCode !== 8) { //insert your value and < or >
e.preventDefault();
$(this).val(65); //insert maximum/minimum value here
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment