SelectFilter is a jQuery plugin for creating dependent select boxes where options are derived based on the value selected from other select element(s).
Link to jQuery library and the jQuery SelectFilter plugin's script
<scriptsrc="http://code.jquery.com/jquery.min.js"></script><scriptsrc="selectFilter.min.js"></script>Create select boxes and uses HTML5 data attributes to configure the dependent select options.
<selectdata-target="secondList" class="firstList selectFilter"><optionvalue="-1">Select</option><optiondata-ref="one" >First One</option><optiondata-ref="two" >First Two</option><optiondata-ref="three">First Three</option></select><br/><br/><selectdata-target="thirdList" class="secondList selectFilter"><optionvalue="-1">Select</option><optiondata-ref="A" data-belong="one" >First One</option><optiondata-ref="B" data-belong="two">First Two</option><optiondata-ref="C" data-belong="three">First Three</option><optiondata-ref="D" data-belong="one">Second One</option><optiondata-ref="E" data-belong="two">Second Two</option><optiondata-ref="F" data-belong="three">Second Three</option></select><br/><br/><selectclass="thirdList selectFilter"><optionvalue="-1">Select</option><optiondata-belong="A" >First One</option><optiondata-belong="B">First Two</option><optiondata-belong="C">First Three</option><optiondata-belong="D">Second One</option><optiondata-belong="E">Second Two</option><optiondata-belong="F">Second Three</option><optiondata-belong="A">Third One</option><optiondata-belong="B">Third Two</option><optiondata-belong="C">Third Three</option></select>- selectFilter is a class for select to enable selectFilter plugin.
- data-target is use to target class of all select.
- data-ref is use to refer the value to filter.
- data-belong is use to filter the select by data-ref.
Check the website for more information.