var cellfour = row.insertCell(3); var el = document.createElement('select'); el.name = 'select' + iteration; el.id = 'select' + iteration; //here i like to add onchange event but it wont works el.onchange=" return alert('hi')"; cellfour.appendChild(el); arr=["Input","Select","CheckBox","Radio"]; for ( i=0;i<arr.length;i++) { var opt1=document.createElement('option'); opt1.text=arr[i]; el.options.add(opt1);
addEventListener
attachEvent
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)