'How i can show a selected item of a dropdown in the label in bootstrap5?

I would like to show the user the item(s) he has selected from the dropdown list in the label: With this image, you can see what I really want to do.
here is my code:

      `  <ul class="dropdown-menu rounded" aria-labelledby="dropdownMenuBed">
            <li><a class="dropdown-item" href="">ANY</a></li>
            <li><a class="dropdown-item" href="">1+</a></li>
            <li><a class="dropdown-item" href="">2+</a></li>
            <li><a class="dropdown-item" href="">3+</a></li>              
            <li><a class="dropdown-item" href="">4+</a></li>
          </ul>

`

Thanks a lot in advance for your help!



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source