Answers for "how to set max length in javascript"

0

how to limit input type max length

<input name="somename"
    oninput="javascript: if (this.value.length > this.maxLength) this.value = this.value.slice(0, this.maxLength);"
    type = "number"
    maxlength = "6"
 />
Posted by: Guest on April-30-2020
1

find max value in javascript

x = findMax(1, 123, 500, 115, 44, 88);

function findMax() {
  var i;
  var max = -Infinity;
  for (i = 0; i < arguments.length; i++) {
    if (arguments[i] > max) {
      max = arguments[i];
    }
  }
  return max;
}
Posted by: Guest on November-25-2020
1

How to get maximum value in Javascript

let x = Math.max(1,3,45,59,698);
console.log(x);  //output 698
Posted by: Guest on February-25-2021

Code answers related to "how to set max length in javascript"

Browse Popular Code Answers by Language