Skip to content Skip to sidebar Skip to footer

Javascript Appendchild Name Property

So I'm trying to add attributes to a radio button input, specifically the name attribute in Javascript. I'm appending children to a main object and when I use Object.setAttribute('

Solution 1:

Here's a workaround for dealing with IE:

http://javascript.about.com/library/bliebug2.htm

http://www.thunderguy.com/semicolon/2005/05/23/setting-the-name-attribute-in-internet-explorer/

Essentially, the method used is to create the elements on the fly instead of modifying existing elements.

Solution 2:

In IE, you cannot add a name attribute on dynamically created objects.

I suggest using id if unique, or a class if not.

Post a Comment for "Javascript Appendchild Name Property"