Wednesday, May 9, 2012

Integer validation in JavaScript

function isInteger(val) {
    var intRegEx = /\D/g;
    return (!intRegEx.test(val));
}

1 comment:

  1. I have been looking for this code. It has been quite helpful in my Javascript. Its really nice of you to share solution codes on this blog which is really helpful for us.

    ReplyDelete