check to see if string contains numbers javasctip code example
Example 1: check if a string contains digits js
function hasNumber(myString) {
return /\d/.test(myString);
}
Example 2: js string have number js
var hasNumber = /\d/;
hasNumber.test("ABC33SDF"); //true
hasNumber.test("ABCSDF"); //false