Periksa apakah string berisi digit JS
function hasNumber(myString) {
return /\d/.test(myString);
}
Embarrassed Elephant
function hasNumber(myString) {
return /\d/.test(myString);
}
var hasNumber = /\d/;
hasNumber.test("ABC33SDF"); //true
hasNumber.test("ABCSDF"); //false