I would like to “attach” the div to the drop down list. Is it possible?
I need something like this:

To be clear, I do not need to add div to the correct dropdownlist dispatcher. I just need to attach.
What I have tried so far and not work:
HTML
<select id="platypusDropDown"> <option value="duckbill">duckbill</option> <option value="duckbillPlatypus">duckbillPlatypus</option> <option value="Platypus">Platypus</option> <option value="Platypi">Platypi</option> </select> <div id="addCategory"> <input id="categoryInput" type="text" /> <br/> <input id="categoryInputAddBtn" type="button" value="Add new" /> </div>
Js
$('#platypusDropDown').click(function () { var myDiv = document.getElementById('addCategory'); this.append(myDiv); });
Any solution? Thanks in advance.
source share