it is possible to open drop down list without mouse click and using pure JavaScript ?
2 Answers
This is assuming you mean a dropdown nav menu, not a <select>.
<ul> <li><a>hover here</a> <ul> <li>Link 1</li> <li>Link 2</li> <li>Link 3</li> <li>Link 4</li> </ul> </li> </ul> css:
ul li ul { display: none; } ul li:hover ul { display: block; } 4 Comments
Joe Simmons
How is an unordered list a drop-down list?
elreimundo
@Joe Simmons, this is a common way to make "drop-down lists" using CSS, particularly for things like nav bars.
m59
Does he mean "select". That question is terribly unclear, then. Dropdown menu's are made with lists (ul li) so...why shouldn't I expect this to be a good answer?
Joe Simmons
Ah, I see now that you edited the code. Not bad.
<select>or a dropdown menu for navigation links?