quassstion
Tue Feb 28 2023 09:41:36 GMT+0000 (Coordinated Universal Time)
Saved by
@abd
#javascript
/* why if i didnt add(return false) i cant see the result of my console */
document.getElementById('reg').onsubmit=()=>{
let phoneinput=document.getElementById('phone').value
let phoneRe=/\(\d{4}\)\d{3}-\d{4}/ig //(1234)567-8910
let validationResult=phoneRe.test(phoneinput)
console.log("🚀 ~ file: main.js:5 ~ document.getElementById ~ validationResult:", validationResult)
// return false
}
content_copyCOPY
Comments