Comment To make it work in IE, catch an exception (Score 1) 528
Had a "bug" yesterday in IE (which threw no errors) and finally found this on w3c schools as the official example of how to add a select option. I wonder if they were trying to be funny in subtle way.
<script type="text/javascript">
function insertOption()
{
var y=document.createElement('option');
y.text='Kiwi'
var x=document.getElementById("mySelect");
try
{
x.add(y,null); // standards compliant
}
catch(ex)
{
x.add(y); // IE only
}
}
</script>
<script type="text/javascript">
function insertOption()
{
var y=document.createElement('option');
y.text='Kiwi'
var x=document.getElementById("mySelect");
try
{
x.add(y,null);
}
catch(ex)
{
x.add(y);
}
}
</script>