Martin,
I write all my code for Windows & IE
I noticed some of your code had attributes that were not quoted. W3C says...
Sometimes I assemble/modify the html as a string, then use set_html. All of my html is loaded as a string
I've got 3 or 4 'dynamic' web dialogs in an extension at
http://www.ChampionEnt.net/tech/ur/
if any of it might interest you, let me know and I can post or send the code.
Due to the 'modal window' issue, some of the code only works on a PC (settings window)
Haven't really tested it lately on an Apple...
Wrote some C# code to change an html file into a Ruby friendly string
HTH,
Greg