Skip to content

How to check if a dropdown is open? #2697

Closed Answered by saadeghi
jmrossy asked this question in Q&A
Discussion options

You must be logged in to vote

Method 1 dropdown works with HTML <details> tag so you can use the ontoggle event to check if it's open or not:
https://www.cssportal.com/html-event-attributes/ontoggle.php

Method 2 dropdown works with CSS focus so you can use onfocus event:
https://www.cssportal.com/html-event-attributes/onfocus.php

Let me know if you have a question.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@jmrossy
Comment options

Answer selected by saadeghi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants