<html> <head> <script> var p = /\D/; function testMatch() { var str = textfield.value; if (p.test(str)) { alert(" The string "+ str + " contains non-digits."); } else { alert("The string " + str + " does not contain non-digits."); } } </script> </head> <body> <h3>Checking the availability of character in given range.</h3> Enter the String: <input type="text" id="textfield" /> <input type="button" value="Check" onclick="testMatch();" /> </body> </html>