I'm trying to do prevent a user from having the same value in two drop down menus. Jquery is returning true regardless of the values selected.
$("select[id$='go']").change(function() {
var value = $(this);
$("select[id$='go']").each(function() {
if ($(this).val() === value.val()) {
$('#work').html("DUBS");
}
});
});
<select id="_go">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>
<select id="_gogo">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>
<div id="work"></div>
Is there a proper way to do this?