Jump to content

Bootstap dropdown list selection


seoras

Recommended Posts

Maybe I’m just too stupid to work this out but it seem to me that the bootstrap dropdown list examples are missing out the obvious – that is, actually showing how to get the selection, which is surely the purpose of any dropdown list. For example, see this:

https://www.w3schools.com/bootstrap/bootstrap_ref_js_dropdown.asp (dropdown events)

It shows how to ascertain that the list title or header has been clicked on but not the actual selected item from the list – which is surely the purpose of the list, yet this is not shown as if it had no relevance. What am I missing here?

Link to comment
Share on other sites

The contents of the dropdown menu are just regular HTML elements, so you do it the same way you do anything else.  If you just want them to go to another page, then you can use a regular anchor element with the href set to wherever you want them to go.  Or, you can attach click handlers to specific menu items to run some code when that item is clicked.  It's fairly flexible in terms of the structure of the list, and you can attach the same kind of event handlers to the elements in the list that you can attach to anything else.

Link to comment
Share on other sites

Well, it seems the first few words of my post are the most relevant becuase nothing is working for me with these examples. Visually appealing but doing nothing. In the 'school', an example would have been nice for the clearly terminally stupid such as myself.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...