SAI YEWALE

Generation

typingsThu, 15 Dec 2022

regular expression for mobile no. length must be 10 in javascript

function mobile(inputtxt){ var phoneno = /^\d{10}$/; if((inputtxt.value.match(phoneno))){ return true; } else{ alert("Not a valid Phone Number"); return false; } }

Questions about programming?Chat with your personal AI assistant