I would like to multiply the value that is entered in the userInput field by 20 so that the fields with class xafields display 20 times what is entered in the userInput. (Enter 1, 20 of each field is added, enter 2, 40 of each field is added, etc.).
jQuery("#userInput").change(function() {
var htmlString = "";
var len = jQuery(this).val();
for (var i = 0; i <= len; i++) {
htmlString += 'Name<br /><input class="xafields" type="text"><br />';
htmlString += 'Email<br /><input class="xafields"><br /><br />';
}
jQuery("#xafieldContainer").html(htmlString);
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<input id="userInput">
<div id="xafieldContainer"></div>
lenby 20.