JSFiddle - React, Tailwind, and code Playground
HTML
<h4>People planner</h4>
<table>
<tr>
<td>
Run the fun house with:
</td>
<td>
<select>
<option value="67">Tony Hart</option>
<option value="68" selected='true'>Pat Buchanan</option>
<option value="69">Bosco</option>
<option value="70">Dan Aykroyd</option>
</select>
</td></tr>
<tr>
<td>
Learn Irish with:
</td>
<td>
<select>
<option value="67" selected='true'>Tony Hart</option>
<option value="68">Pat Buchanan</option>
<option value="69">Bosco</option>
<option value="70">Dan Aykroyd</option>
</select>
</td></tr>
<tr><td>
Paint a picture with:
</td>
<td>
<select>
<option value="67">Tony Hart</option>
<option value="68">Pat Buchanan</option>
<option value="69" selected='true'>Bosco</option>
<option value="70">Dan Aykroyd</option>
</select>
</td></tr>
</table>
<a href="https://gist.github.com/JonMidhir/7042874">Gist here.</a>
CSS
table {
margin-bottom: 40px;
}
CoffeeScript
$.fn.dependentSelect = ->
$(@).addClass('dependent')
@each ->
$(@).data('pre', $(@).val())
@disableOthers = ->
$('select.dependent')
.not($(@))
.find("option[value=#{$(@).val()}]")
.prop('disabled', true)
@disableOthers()
$(@).on 'change', (e) =>
$target = $(e.currentTarget)
prev = $target.data('pre')
$("select.dependent option[value=#{prev}]")
.prop('disabled', false)
@disableOthers()
$target.data('pre', $target.val())
$(document).ready ->
$('select').dependentSelect()