Trying to figure out how to get a selects selected option where there is no id or class to use as a selector, but is contained within a specific div (theres multiple selects on the page I only want this one).
Not sure if I should do something with find, parent, sibling, other…
Example of what I am working with.
<div id="mydiv">
<select name="myselect">
<option selected="selected" value="1">Hi</option>
</select>
</div>
You can use the
>symbol to select direct children.:selectedreturns selected options.If you want all selected options use this:
To get the
selectelements of those selected options: