<p>I just learned something interesting. The add method for the javascript select object in IE 6 takes only one parameter. It throws an error when you pass it two parameters which I believe is the <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-html.html" rel="noreferrer">standard</a>, even as <a href="http://msdn.microsoft.com/en-us/library/aa768859(VS.85).aspx" rel="noreferrer">documented</a> on the MSDN site.</p>

<p>My question is this. What is your best-practice recommendation for programmatically adding option elements to a select element in javascript?</p>

<ul>
<li>Call the add method differently based on the value of the user agent?</li>
<li>Wrap the select object in a class that provides the proper method signature?</li>
<li>Use a javascript library which does this for you (specify which library)?</li>
</ul>

Adding a new Option type works at least IE6 and up
```
```
function addOption(selectID, display, value)
{
  var obj = document.getElementById(selectID);
  obj.options[obj.options.length] = new Option(display, value);
}
```
```
Additionally tested in Firefox 2, 3, Opera 8, 9.5, and Safari 4 successfully.  IE4 failed :(