Tuesday, August 01, 2006

Internet Explore can not add 'name' attribute to radio button dynamically.

When I added radio button element by using DOM method, 'name' attribute did't apper correctly in Internet Explore.

Please reffer this web site.

I changed my code like this.

// for DOM compatible.
if (navigator.appName.indexOf("Microsoft Internet Explorer") == -1) {
  obj = document.createElement( "input" );
  obj.name = "group1";
}
// for IE.
else
  obj = document.createElement( "<input name='group1'>" );


tags:
javascript

No comments:

Post a Comment