therainmaker53 Posted February 12, 2007 Share Posted February 12, 2007 Hi Guys, I'm trying to create a drop down list (select list)using javascript, it works fine in FireFox but not in IE 6. (Not sure about 7) The code I am using is: var select = document.createElement('select'); select.setAttribute("name", "compChoice"); td2.appendChild(select); td2 is a td table element which work fine when dynamically created in other parts of the application. I also populate the select list using javascript from values from a xml document. I would be very grateful if anyone had any ideas on how to solve this problem? Thanks all, Sean. Quote Link to comment Share on other sites More sharing options...
ozfred Posted February 13, 2007 Share Posted February 13, 2007 I'm trying to create a drop down list (select list)using javascript, it works fine in FireFox but not in IE 6. (Not sure about 7) IE's support for the W3C DOM is patchy, especially in regard to select elements. var select = document.createElement('select'); select.setAttribute("name", "compChoice"); td2.appendChild(select); td2 is a td table element which work fine when dynamically created in other parts of the application. Just set the select element's properties directly; select.name = 'compChoice'; To insert options, use new Option() . <URL: http://www.quirksmode.org/js/options.html > -- Fred Javascript FAQ: <URL: http://www.jibbering.com/faq/ > Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.