3
I have the following code:
<select>
<optgroup label="fruta">
<option value="banana">banana</option>
<option value="uva">uva</option>
</optgroup>
<optgroup label="legume">
<option value="batata">batata</option>
<option value="cenoura">cenoura</option>
</optgroup>
</select>
<div id="label_value"></div>
I would like in Jquery to take the value of the label and value and play in a div.
Hello Sergio, is it possible to write the first options in the div? Like: In html the first option is banana fruit. You can already show up before the user chooses something else?
– Profº Rafael Ferreira
@Schoolgirl, yes, just do it
$('select').change();
-> http://jsfiddle.net/cujweb2h/1/– Sergio
Once again, thank you.
– Profº Rafael Ferreira