/    Sign up×
Community /Pin to ProfileBookmark

Arrow down/up to select in a list?

Instead of the <select> popup menu with practically no way to style…
https://www.w3schools.com/html/tryit.asp?filename=tryhtml_elem_select

… I did an experiment of replacing this with details/summary. But then I lose the ability to navigate using arrows.
https://jsfiddle.net/pr65a7zk/3/

Is there a way to get the arrows to work within the details?

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@SempervivumJun 28.2022 — Styling is easier when using Selectize or Select2:

https://selectize.dev/demos/2015/01/01/single-item-select/

https://select2.org/getting-started/basic-usage

Arrow keys are working in the examples
Copy linkTweet thisAlerts:
@sibertauthorJun 29.2022 — > @Sempervivum#1645058 Styling is easier when using Selectize or Select2:

Thank you. And without using JQuery?
Copy linkTweet thisAlerts:
@SempervivumJun 29.2022 — @sibert#1645063

Unfortunately these are the only ones I know about. They are very powerful and highly customisable.

An alternative might be coding the reaction to the arrow keys yourself.
×

Success!

Help @sibert spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 4.25,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...