JSFiddle - React, Tailwind, and code Playground
HTML
<select id="result-1"></select>
<select id="result-2"></select>
JavaScript
function myFunc (max, text, target) {
var $frag = $(document.createDocumentFragment());
for(var i = 0; i < max; i++) {
$('<option />', {text: text}).appendTo($frag);
}
$(target).append($frag)
}
myFunc(3, 'пункт', '#result-1')
//myFunc(3, i + 1, '#result-2') // нужно вывести 1, 2, 3