答案 0 :(得分:0)
我不确定我是否理解你的需要,但我会尽力回答。
当你在谈论jQuery时,我有这个解决方案:
$("#my-select").change(function() {
// $(this) refers to the select element
$(this).find("option:selected").each(function() {
// this function is called only once per change
// $(this) refers to the selected option
})
});
现场例子:
$("#my-select").change(function() {
// $(this) refers to the select element
$("#s_value").text($(this).val());
$("#s_text").text($(this).find("option:selected").text());
$(this).find("option:selected").each(function() {
// this function is called only once per change
// $(this) refers to the selected option
$("#o_value").text($(this).val());
$("#o_text").text($(this).text());
})
})

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<select id="my-select">
<option value="1">Option 1</option>
<option value="2">Option 2</option>
<option value="3">Option 3</option>
</select>
<br>SELECTED (FROM SELECT) :
<br>Value : <span id="s_value"></span>
<br>Text : <span id="s_text"></span>
<br>
<br>SELECTED (FROM OPTION) :
<br>Value : <span id="o_value"></span>
<br>Text : <span id="o_text"></span>
<br>
<br>
&#13;
答案 1 :(得分:0)
从讨论中可以看出,没有符合指定要求的DOM事件。