You may not have <div> elements in <select> , see for example fooobar.com/questions/1455644 / ... , which refers to this bit of the HTML specification.
In addition, the hide options are not compatible with the browser (see fooobar.com/questions/63086 / ... , as @Voitek Zylinski suggests, you would probably be better off saving multiple copies of the selection and switching between them, or if you want to keep the attribute id , or maybe even configure innerHtml (yuck ...).
You could approach it like this:
Markup
<select onchange="doOperation()" class="js-opt-a"> <option value="default"> Start..</option> <option value="1"> 1</option> <option value="2"> 2</option> <option value="3"> 3 </option> </select> <select onchange="doOperation()" class="js-opt-b"> <option value="default">Start...</option> <option value="4"> 4 </option> <option value="5"> 5 </option> </select>
Js
function doOperation() { } $(".js-opt-a").hide(); $(".js-opt-b").show();ββ
See for example this jsfiddle
Not quite perfect though!
source share