|
|
Setting name attribute for an element dynamically in IE - Javascript
|
Views : 412
|
|
Tagged in : Javascript
|
|
|
Report This Scrap as Inappropriate We request you to choose the appropriate categroy and subcategory that suits your
objectionable concern about the scrap, So that our team can review and find out whether it violates our Guidelines or the
scrap is not suitable for all viewers.
|
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 |
|
|
|