行。
html:
<div class="selector">
<select name="something"> //this is what myVar is referring to.
<option>stuff</option>
</select>
</div>
假设我有 var:
var myVar = $(".selector").find("[name=something]");
我想与 option:selected 连接:
$(myVar here + " option:selected").change(function(){
//do something
});
我似乎无法完成这项工作。感谢任何能提供帮助的人。