-2

I'm currently validating a form with JavaScript in which the user has to type their id number . I already figure out how to validate if the value is numeric, but I'm struggling to find a way to validate if the given number is integer or not.

SecretAgentMan
  • 2,856
  • 7
  • 21
  • 41

1 Answers1

1

Try this:

Number.isInteger(Number(input))
Grey Chanel
  • 212
  • 1
  • 5