This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<select class="selectBox"> | |
<option value="disabled" selected="selected">Disabled</option> | |
<option value="saab">Saab</option> | |
<option value="mercedes">Mercedes</option> | |
<option value="audi">Audi</option> | |
</select> | |
<select class="selectBox"> | |
<option value="disabled" selected="selected">Disabled</option> | |
<option value="saab">Saab</option> | |
<option value="mercedes">Mercedes</option> | |
<option value="audi">Audi</option> | |
</select> | |
<select class="selectBox"> | |
<option value="disabled" selected="selected">Disabled</option> | |
<option value="saab">Saab</option> | |
<option value="mercedes">Mercedes</option> | |
<option value="audi">Audi</option> | |
</select> | |
<select class="selectBox"> | |
<option value="disabled" selected="selected">Disabled</option> | |
<option value="saab">Saab</option> | |
<option value="mercedes">Mercedes</option> | |
<option value="audi">Audi</option> | |
</select> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('.selectBox').change(function() { | |
var current = $(this).val(); | |
$(this).siblings().each(function() { | |
var val = $(this).val(); | |
if(current == val) { | |
$(this).val('disabled'); | |
} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment