Hello, please tell me how to set the css-class component when it is created dynamically. A piece of code:
tmode = document.createElement('td'); tmode.setAttribute('id', "td_0" + t_index); selector = document.createElement('select'); selector.setAttribute('id', "tmode" + t_index); tmode.appendChild(selector); for (i=0; i<3; i++) { // Добавляем итемы в selector items = document.createElement('option'); items.innerHTML = tmode_values[i]; selector.appendChild(items); } tmode.appendChild(selector); Here is what I want to get:
<select class="basic" id='tmode1'> <option>1</option> <option>2</option> <option>3</option> </select>