Html – how to show selected item in dropdown
I have the code shown below [I am using JQuery and Bootstrap 4]: $('.dropdown-menu li').on('click', function() { var getValue = $(this).text(); $('.dropdown-select').text(getValue); }); <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css"> <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/jquery.slim.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/popper.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script> <div class="col-auto p-2 col-5"> <div class="dropdown"> <button id="dLabel"…