Answers for "how to set max value for input type number"

0

html input max vs maxlength

<input type="text" maxlength="4"/>
Posted by: Guest on April-13-2021
1

input type number max value validation

/* comman function for all input by joshi yogesh {[email protected]} */

$(function () {
   $( "input" ).change(function() {
   var max = parseInt($(this).attr('max'));
   var min = parseInt($(this).attr('min'));
   if ($(this).val() > max)
   {
      $(this).val(max);
   }
   else if ($(this).val() < min)
   {
      $(this).val(min);
   }
Posted by: Guest on January-24-2021

Code answers related to "how to set max value for input type number"

Browse Popular Code Answers by Language