Check if a value is numeric or not


/ Published in: JavaScript
Save to your folder(s)

With decimal separator "."


Copy this code and paste it in your HTML
  1. function checkNumeric(value){
  2. var anum=/(^\d+$)|(^\d+\.\d+$)/
  3. if (anum.test(value))
  4. return true;
  5. return false;
  6. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.