Código :
var num = document.getElementById('select-crear') var num2 = num.options[num.selectedIndex].value; for(var i=0; i < num2; i++) { var x = document.createElement("div"); x.innerHTML = "<div id='select"+i+"' onchange='elegir(select"+i+");'></div>"; }