JSFiddle - React, Tailwind, and code Playground
HTML
<label for='createTextboxes'>Number of boxes to create:</label>
<select id='createTextboxes'>
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
</select>
<div id=screens></div>
JavaScript
function create(param) {
'use strict';
var i;
$("#screens").empty();
for (i = 0; i < param; i += 1) {
$('#screens').append('<input type="text" name="Fname">');
}
}
$('#createTextboxes').change(function () {
'use strict';
create($(this).val());
});