How can i add pattern="[0-9]+" to the div in this js code ?
var max_fields = 10; //maximum input boxes allowed
var wrapper = $(".input_fields_wrap"); //Fields wrapper
var add_button = $(".add_field_button"); //Add button ID
var x = 1; //initlal text box count
$(add_button).click(function(e){ //on add input button click
e.preventDefault();
if(x < max_fields){ //max input box allowed
x++; //text box increment
$(wrapper).append('<div class="delivery-num-input"><input type="text" pattern="[0-9]+" class="form-control delivery_number_plus"/><a href="#" class="remove_field btn btn-sm btn-danger">Remove</a></div>'); //add input box
}
});
patternproperty is only applicable to input types, isn't it?