I want to add one in javascript inside an HTML created.
<select name="testSelect">
<optgroup label="opt1">
<option value="3">Apples</option>
</optgroup>
<optgroup label="opt2">
</optgroup>
</select>
In this example I want to add the option inside the opt2 label. Something like this but inside the optgroup.
$("testSelect").set("value", 1);
$("testSelect").set("text", teste);