Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <head>
- </head>
- <div class="container w-50 m-5 border-5">
- <span> info</span>
- <div class="input-group mb-3">
- <div class="input-group">
- <span class="input-group-text">First and last name</span>
- <input type="text" aria-label="First name" class="form-control">
- <input type="text" aria-label="Last name" class="form-control">
- </div>
- </div>
- <input class="mt-3" type="date" value="2001-01-01">
- <div class="dropdown">
- <button class="btn btn-outline-secondary dropdown-toggle" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
- Choose Team
- </button>
- <div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
- <!-- add from script-->
- </div>
- </div>
- <a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="WishList">Next</a>
- </div>
- <script src="https://code.jquery.com/jquery-2.2.4.js"></script>
- <script>
- $(function () {
- for (let i = 0; i < 3; i++) {
- addTeamInDropdown("Team " + (i + 1));
- }
- $(".dropdown-menu a").click(function () {
- $(".btn:first-child").text($(this).text());
- $(".btn:first-child").val($(this).text());
- });
- });
- const addTeamInDropdown = function(teamName){
- $(".dropdown-menu").append(
- '<a class="dropdown-item" href="#">' + teamName + '</a >'
- );
- }
- </script>
Advertisement
Add Comment
Please, Sign In to add comment