1

I have an empty select list on which i have binded custom drop down. On clicking on empty select, it comes into focus and shows the empty option list(which is blue in color with black border) Is there a way in css so that we can hide that entire empty option section.

<select id="displaydropdown"></select> <!--empty select list-->
<script>
   //on displaydropdown click show/hide custom dropdown
</script>

In this case custom drop down is visible, along with that empty select list is also visible. i want to hide that internal list box of select list. Currently i am looking into user agent stylesheets to see whether we can override its default functionality.

Please let me know if anymore details.

user2406618
  • 144
  • 1
  • 2
  • 12

1 Answers1

0

Try this described in this demo:

HTML:

<select id="displaydropdown"></select>

CSS:

#displaydropdown:empty {
   display: none;
}
Shashank
  • 2,010
  • 2
  • 18
  • 38
  • i want to hide the default internal list box/ menulist of select tag and not the select tag itself. If you try clicking on empty select you can see blue/black dropdown. i want to hide that. its default browser functionality. – user2406618 Feb 23 '16 at 05:07