JSFiddle - React, Tailwind, and code Playground
HTML
<table id="foo">
<tbody>
</tbody>
</table>
CSS
.table {height:100px;
border: solid 1px;}
JavaScript
function init(){
idAndNameDuSelect="select1"; //concaténation
var tr = document.createElement('tr');
var td = document.createElement('td');
var zone=document.createElement('select');
zone.setAttribute("id",idAndNameDuSelect);
zone.setAttribute("name",idAndNameDuSelect);
zone.style="min-width:50px;";
zone.size = "1";
var tabOption = new Array(
new Option("type", "", false, false),
new Option("option1", "client", false, false),
new Option("option2", "notClient", false, false)
);
for (j=0;j<tabOption.length;j++){
zone.appendChild(tabOption[j]);
}
td.appendChild(zone);
tr.appendChild(td);
document.getElementById('foo').getElementsByTagName('tbody')[0].appendChild(tr);
}
document.body.onload=init();