"); id = temp.value; var re; re = /^[0-9]+$/; var digits = /\d(10)/; if (id == "") { return ("Please Enter Mobile no" + "\n"); } else if (re.test(id)) { return ""; } else { return ("Phone no should be digits only" + "\n"); } }