Create dependent select lists.
JavaScript
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
LICENSE
README.md
example.html
jquery.selectbind.js

README.md

jQuery selectBind

Create dependent select lists.

Usage

$('.select-child').selectBind('#select-parent', {
  one: [
    { value: 'val1', text: 'This is Value 1' },
    { value: 'val2', text: 'This is Value 2' },
    { value: 'val3', text: 'This is Value 3' }
  ],
  two: [
    { value: 'val2', text: 'This is Value 2' }
  ]
});

Markup:

<p>
  <select id="select-parent">
    <option value="one">One</option>
    <option value="two">Two</option>
    <option value="three">Three</option>
    <option value="four">Four</option>
  </select>
</p>
<p>
  <select class="select-child"></select>
</p>
<p>
  <select class="select-child"></select>
</p>