Say I have:
HTML:
<select id="mySelect"><option value="0">option-1</option>...</select>
JS:
var select = $("#mySelect");
and I further down, I want to do:
var val = $("#mySelect option:selected").val();
I've tried this, but it seems to only return the text, not the value attribute:
$(select + "option:selected").val();
$(select + "option:selected").attr("value"); // also doesn't work