Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!

 



Forgot your password?
typodupeerror

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>

Slashdot Top Deals

God help those who do not help themselves. -- Wilson Mizner

Working...