How to add validation of mobile no. Html code:<input type="text" id="mob" name="mob[]" placeholder="Enter mobile no" required>
js code
container.appendChild(document.createTextNode("mobile")); var input_m = document.createElement("input"); input_m.type = "text"; input_m.id= id+'_mobile'; input_m.name= "mob[]"; container.appendChild(input_m);
/[7-9][0-9]{9}/. Note this is a basic validation regex. This will not cover cases like9999999999