1

How to do that by clicking on the language selection icon, a list of available languages ​​(UA, EN, IT) drops out. When you click on one of them, the list of languages ​​is hidden and the selected one appears in this icon?

    header .leftSide,
    header .rightSide
    {
        display: flex;
        align-items: center;
    }
    <div class="language">
    <ul>
      <li><a id="LANG" href="#">RU</a></li>
      <li><a id="LANG" href="#">ENG</a></li>
      <li><a id="LANG" href="#">IT</a></li>
    </ul>
</div>

enter image description here

Community
  • 1
  • 1

1 Answers1

0

Use .click() a and in function hide() list and style li as below:

$('.a-tag').click(function() {
  $('.language').hide();
});
li{
    border-radius: 50%;
    border: 1px solid black;
    padding: 5px;
    margin: 5px;
    width: fit-content;
    list-style-type: none;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div class="language">
    <ul>
      <li><a id="LANG1" class="a-tag" href="#">RU</a></li>
      <li><a id="LANG2" class="a-tag" href="#">ENG</a></li>
      <li><a id="LANG3" class="a-tag" href="#">IT</a></li>
    </ul>
</div>
לבני מלכה
  • 15,925
  • 2
  • 23
  • 47