R
R
root092021-06-14 12:04:22
JavaScript
root09, 2021-06-14 12:04:22

How to make a dropdown list correctly if you need to apply it in several places?

What is the correct way to implement the same dropdown list for multiple items? For example for the list of comments.

Each comment has a button to complain, by clicking on which a list of reasons should appear.

There are many libraries for implementing dropdown, for example, bootstrap, but it would not be right to put ul into each block with a comment. (100 comments will have 100 uls with reasons)
I looked at how it was done on other sites, where this ul is added to the comment block only when the button is clicked.

Are there any ready-made libraries that will help to implement this?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question