Setting name attribute for an element dynamically in IE - Javascript Views : 412
Tagged in : Javascript
0 0
Send mail
Normally we will use the following to create an element dynamically,


var sell = document.createElement("select");
sell.setAttribute("id",val);
sell.setAttribute("name","ss");
sell.setAttribute("onChange","sett()");


This will work in Firefox but not in IE.To make it work in IE use the following code,


var sell = document.createElement("<select name=ss>");
sell.setAttribute("id",val);
sell.onchange = function(){sett()};



This will work in Internet Explorer.
By Rekha, On - 2009-10-15



    Login to add Comments .