78
rated 0 times
[
82]
[
4]
/ answers: 1 / hits: 41336
/ 15 Years ago, wed, december 23, 2009, 12:00:00
I'd like jQuery to detect when the option with the id trade_buy_max
is selected.
$(document).ready(function() {
$(option#trade_buy_max).select(function () {
//do something
});
});
<script src=https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.0/jquery.min.js></script>
<select name='type' id='type'>
<option id='trade_buy' value='1' selected='selected'>Buy</option>
<option id='trade_buy_max' value='1'>Buy max</option>
<option id='trade_sell' value='2'>Sell</option>
<option id='trade_sell_max' value='2'>Sell max</option>
</select>
I've tried the following, but it doesn't seem to work.
Any ideas?
More From » jquery