Getting all selects with the same selected value in Prototype $$()?
How get all select with the same "selected value" in Prototype $$()?
Example: all select with "5" select value
<select name="first">
<option value="">-- Selecione --</option>
<option value="4">Auxiliar de vistoria</option>
<option selected="selected" value="5">Examinador</option>
</select>
<select name="second">开发者_如何学Python
<option value="">-- Selecione --</option>
<option selected="selected" value="4">Auxiliar de vistoria</option>
<option value="5">Examinador</option>
</select>
Thanks, Celso
Try:
$$('select:has(option:selected[value=5])')
Fiddle: http://jsfiddle.net/doktormolle/a5t4a/
精彩评论