Αποτελέσματα Αναζήτησης
20 Δεκ 2013 · Use following code : $(".dropdown-menu li").click(function { var selectedOption = parseInt($(this).attr('data-value'), 10); $("#expiry_month").val(selectedOption.toString()); console.log( $("#expiry_month").val()); });
A dropdown menu is a toggleable menu that allows the user to choose one value from a predefined list. For a tutorial about Dropdowns, read our Bootstrap Dropdowns Tutorial. The Dropdown Plugin Classes. Via data-* Attributes. Add data-toggle="dropdown" to a link or a button to toggle a dropdown menu. Example.
Bootstrap’s dropdowns, on the other hand, are designed to be generic and applicable to a variety of situations and markup structures. For instance, it is possible to create dropdowns that contain additional inputs and form controls, such as search fields or login forms.
Dropdowns are toggleable, contextual overlays for displaying lists of links and more. They’re made interactive with the included Bootstrap dropdown JavaScript plugin. They’re toggled by clicking, not by hovering; this is an intentional design decision.
Use any element to open the dropdown menu, e.g. a <button>, <a> or <p> element. Use a container element (like <div>) to create the dropdown menu and add the dropdown links inside it. Wrap a <div> element around the button and the <div> to position the dropdown menu correctly with CSS.
6 Μαρ 2021 · Collection of free custom responsive Bootstrap dropdown menu code examples. Update of September 2020 collection. 15 new items.
To open the dropdown menu, use a button or a link with a class of .dropdown-toggle and the data-toggle="dropdown" attribute. The .caret class creates a caret arrow icon ( ), which indicates that the button is a dropdown.