I am trying to create a html dropdown list which should be on top of other divs when selected, but it moves the below div s down and make them be there after selecting dropdown item. Code I tried is in fiddle here. How can I make dropdown float on below div s on selection?
<div class="outer" >
<select id="myselect" style="width:100px;">
<option>abc</option>
<option>def</option>
<option>ghi</option>
<option>jkl</option>
<option>abc</option>
<option>def</option>
<option>ghi</option>
<option>jkl</option>
</select>
</div>
<div class="inner">Enter Name</div>
<div class="inner">Enter Class</div>
</div>
$('#myselect').on('mousedown focus', function () {
$('#myselect').attr('size', 11);
$('#myselect').css('height', '80px');
$('.outer').css('height', '80px');
$('.outer').css('overflow-y', 'scroll');
});
$('#myselect').on('change', function () {
$('#myselect').attr('size', '1');
$('#myselect').css('height', '20px');
});