-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,756
  • 6
  • 18
  • 38

1 Answers1

1

Try this:

Number.isInteger(Number(input))
Grey Chanel
  • 197
  • 5