Stupid IE (2)

To create a multiple select-box with javascript you need a very ugly hack in IE.

if (navigator.appName.match(/Internet Explorer/)) {
	fsel = document.createElement(\'<SELECT MULTIPLE>\');
} else {
	fsel = document.createElement(\'select\');
	fsel.multiple = true;
}

Tags: , , ,

2 Responses to “Stupid IE (2)”

  1. Bas says:

    Of course you could also try the less ugly hack using IE’s conditional comments. It may require you to write IE code in a separate file, though.

  2. It’s not the browser check that I find ugly — it’s the ‘<SELECT MULTIPLE>’ that is so utterly wrong.

Leave a Reply