I need your valuable suggestions and guidance to help me get out of this tricky situation.
I have a scenario, where I need to build a Dropdown like the below one.
<ul class="dropdown">
<li><a href="#">America</a></li>
<li><a href="#">Brazil</a></li>
<li><a href="#">China</a></li>
<li><a href="#">Denmark</a></li>
<li><a href="#">Egypt</a></li>
</ul>
The desired functionality is that I should be able to use keyboard input to scroll through the items, lets say i press key "E" on my keyboard it should hover/focus on Egypt.
I realize this functionality cant be achieved using UL>Li, However we can use Select tag to implement this functionality.
<select class="dropdown">
<option>America</li>
<option>Brazil</li>
<option>China</li>
<option>Denmark</li>
<option>Egypt</li>
<select>
But when we use select tags, we cannot style the dropdown, Especially like CSS padding doesnt work on select tag dropdowns on most broswers.
All I wanna ask Is, How can I build a drop-down with these 3 functionalities :
1.Open on Tab key press
2.Browse listed items using key input.
3.Style the dropdown for cross broswer compatibility.
I did spend ample time in finding a solution for this online, I dint find any perfect solution apart from this plugin
https://silviomoreto.github.io/bootstrap-select/
I'd regret to say that I'm not allowed to use any external plugins at work.To achieve this only tools I'm allowed to use is Bootstrap,jQuery,Javascript,CSS,HTML and no angularjs.
Can anyone help me with this.
What I have tried:
Tried using Html and jquery and also tried using select tags and styling doesn't work !