var newoption = new Option("option html", "option value");
try
{
$('myselect').add(newoption, null);
}
catch (err)
{
$('myselect').add(newoption);
}
To select the newly created option:
newoption.setProperty('selected', 'selected');
var newoption = new Option("option html", "option value");
try
{
$('myselect').add(newoption, null);
}
catch (err)
{
$('myselect').add(newoption);
}
To select the newly created option:
newoption.setProperty('selected', 'selected');