javascript - option belonging to several optgroup -


is possible <option> belongs many optgroup?

i know can this

<select id="menu1">        <optgroup label="fruit">             <option value="pomme">pomme</option>             <option value="kiwi">kiwi</option>        </optgroup>        <optgroup label="exotique">             <option value="kiwi">kiwi</option>        </optgroup>  </select> 

but doesn't make job easy because need handle myself through javascript. hard part i'm using multiselect2side, when user selects kiwi instance, when switches group exotique, must take account kiwi doesn't exist anymore because selected.

the question is, there way html handles natively?

update1

actually select in code above server sends, in javascript script this:

$('#menu1').multiselect2side({     search: 'search: ',     moveoptions: false,     labelsx: '* available *',     labeldx: '* selected *',     autosort: true,     autosortavailable: true }); 

and 2 multi select sides possibility pass values 1 side another.

you can this:

$("select").on('change', function(){   var val=$(this).val();   $(this).find("option[value="+val+"]").attr("disabled",true); }); 

demo


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -