Here is a first run at fixing the issues with appending a string of HTML to select elements. It isn't very pretty and I could use some testers. I've tested the little demo I made in Safari 2.0.4, IE6, Firefox 1.5 on Win and Mac. But testing/using it in your own use-cases will be very helpful.
The patch also takes into consideration optgroup tags, value attributes, selected and label attributes for both optgroup and option tags. One known issue is that it will blow up if you intermix option tags + optgroup tags on the same level. An optgroup can have option tags as children but not as siblings. Any ideas on getting that to work would be appreciated. The work around for this is to just do seperate appends or prepends for option and optgroup tags. The test/demo: http://brandonaaron.net/jquery/select/test.html The src to include in your testing: http://brandonaaron.net/jquery/select/select.js The test/demo without the patch: http://brandonaaron.net/jquery/select/test.broken.html Let me know if I can make any improvements. Thanks! -- Brandon Aaron _______________________________________________ jQuery mailing list [email protected] http://jquery.com/discuss/
