BetinaUKTC

register

Jul 9th, 2021
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.54 KB | None | 0 0
  1.  
  2. <head>
  3.  
  4. </head>
  5.  
  6. <div class="container w-50 m-5 border-5">
  7. <span> info</span>
  8.  
  9.  
  10. <div class="input-group mb-3">
  11. <div class="input-group">
  12. <span class="input-group-text">First and last name</span>
  13. <input type="text" aria-label="First name" class="form-control">
  14. <input type="text" aria-label="Last name" class="form-control">
  15. </div>
  16. </div>
  17.  
  18. <input class="mt-3" type="date" value="2001-01-01">
  19.  
  20. <div class="dropdown">
  21. <button class="btn btn-outline-secondary dropdown-toggle" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
  22. Choose Team
  23. </button>
  24. <div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
  25. <!-- add from script-->
  26. </div>
  27. </div>
  28. <a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="WishList">Next</a>
  29. </div>
  30.  
  31. <script src="https://code.jquery.com/jquery-2.2.4.js"></script>
  32.  
  33. <script>
  34. $(function () {
  35.  
  36.  
  37. for (let i = 0; i < 3; i++) {
  38. addTeamInDropdown("Team " + (i + 1));
  39. }
  40.  
  41. $(".dropdown-menu a").click(function () {
  42.  
  43. $(".btn:first-child").text($(this).text());
  44. $(".btn:first-child").val($(this).text());
  45. });
  46.  
  47. });
  48.  
  49. const addTeamInDropdown = function(teamName){
  50. $(".dropdown-menu").append(
  51. '<a class="dropdown-item" href="#">' + teamName + '</a >'
  52. );
  53. }
  54.  
  55. </script>
Advertisement
Add Comment
Please, Sign In to add comment