Jquery populate optgroup for second selectbox dynamically
问题 I have a very long list of options in two multiple select box, I want to populate dynamically the options for select_B based on select_A , for instance: I multiple select opt1 and opt2 from select_A , select_B will show the options which is optgroup with id=sub1 and id=sub2 only, if I deselect opt1 and select opt3 from select_A , select_B will remove optgroup sub1 and remain sub2 and sub3 , and so on with flexibility of control. <select id="select_A" multiple="multiple" size="10"> <optgroup