简体   繁体   中英

Displaying a div on click of select menu without showing the drop down JavaScript

I have to make a customized drop down menu using JavaScript. On click of select box dropdown appears with the options, I need to customize the appearance of that menu.

My approach is to have a div with the options in it and required styling, when user clicks the select menu that div should appear instead of displaying drop down.

I tried using onclick() events but the dropdown menu appears before and then the div appears. This is not helping the cause.

Please suggest me how to achieve such requirement.

也许你可以隐藏选项?

option { display: none; }

为什么不完全用您自己的 DIV 完全替换?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM