var myCars = ["Full Physical", "Light Physical", "Gesture", "Verbal", "Independent"]; var i = 1; var cellRight = row.insertCell(1); var el = document.createElement('select'); el.type = 'select'; el.name = 'select' + i; el.id = 'optRow' + iteration; el.size = 1; for (var key in myCars) { //alert(); var option = document.createElement("option"); option.text = myCars[key]; option.name = step_value; option.id = myCars[key].id; //option.value = key.value; try { el.add(option, null); //Standard } catch (error) { el.add(option); // IE only } } cellRight.appendChild(el); i = i + 1; }
el.onchange=function(){alert(el.name);};
el.onchange = function () { var sdValues = document.getElementById(el.id); var strUser = sdValues.options[sdValues.selectedIndex].value; };
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)