title: how to get dropdown current value using language with flag?
body: <p>In dropdown we having list of values in <code>&lt;a&gt;</code> tag. For example I am having list of language with flag. By default English is selected. when I change the French language corresponding flag also should be display. Any idea?</p>
  
  <pre><code>&lt;div class="dropdown dropdown-lang"&gt;
      &lt;button class="dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"&gt;
          &lt;span class="flag-icon flag-icon-us"&gt;&lt;/span&gt;
      &lt;/button&gt;
      &lt;div class="dropdown-menu dropdown-menu-right"&gt;
          &lt;div class="dropdown-menu-col"&gt;
              &lt;a href="javascript:;" id="English" onclick="translateLanguage(this.id);" class="dropdown-item current"&gt;&lt;span class="flag-icon flag-icon-us"&gt;&lt;/span&gt;English&lt;/a&gt;
              &lt;a href="javascript:;" id="Italian" onclick="translateLanguage(this.id);" class="dropdown-item"&gt;&lt;span class="flag-icon flag-icon-it"&gt;&lt;/span&gt;Italiano&lt;/a&gt;
              &lt;a href="javascript:;" id="Spanish" onclick="translateLanguage(this.id);" class="dropdown-item"&gt;&lt;span class="flag-icon flag-icon-es"&gt;&lt;/span&gt;Español&lt;/a&gt;
              &lt;a href="javascript:;" id="Belarus" onclick="translateLanguage(this.id);" class="dropdown-item"&gt;&lt;span class="flag-icon flag-icon-by"&gt;&lt;/span&gt;Беларускi&lt;/a&gt;
              &lt;a href="javascript:;" id="Polish" onclick="translateLanguage(this.id);" class="dropdown-item"&gt;&lt;span class="flag-icon flag-icon-pl"&gt;&lt;/span&gt;Polski&lt;/a&gt;
              &lt;a href="javascript:;" id="German" onclick="translateLanguage(this.id);" class="dropdown-item"&gt;&lt;span class="flag-icon flag-icon-li"&gt;&lt;/span&gt;Lietuviu&lt;/a&gt;
              &lt;a href="javascript:;" id="Chinese" onclick="translateLanguage(this.id);" class="dropdown-item"&gt;&lt;span class="flag-icon flag-icon-cn"&gt;&lt;/span&gt;Chinese&lt;/a&gt;
          &lt;/div&gt;
          &lt;div class="dropdown-menu-col"&gt;
              &lt;a href="javascript:;" id="German" onclick="translateLanguage(this.id);" class="dropdown-item"&gt;&lt;span class="flag-icon flag-icon-de"&gt;&lt;/span&gt;Deutsch&lt;/a&gt;
              &lt;a href="javascript:;" id="French" onclick="translateLanguage(this.id);" class="dropdown-item"&gt;&lt;span class="flag-icon flag-icon-fr"&gt;&lt;/span&gt;Français&lt;/a&gt;
              &lt;a href="javascript:;" id="Russian" onclick="translateLanguage(this.id);" class="dropdown-item"&gt;&lt;span class="flag-icon flag-icon-ru"&gt;&lt;/span&gt;Русский&lt;/a&gt;
              &lt;a href="javascript:;" id="Ukrainian" onclick="translateLanguage(this.id);" class="dropdown-item"&gt;&lt;span class="flag-icon flag-icon-ua"&gt;&lt;/span&gt;Українська&lt;/a&gt;
              &lt;a href="javascript:;" id="Czech" onclick="translateLanguage(this.id);" class="dropdown-item"&gt;&lt;span class="flag-icon flag-icon-cz"&gt;&lt;/span&gt;Česky&lt;/a&gt;
              &lt;a href="javascript:;" id="French" onclick="translateLanguage(this.id);" class="dropdown-item"&gt;&lt;span class="flag-icon flag-icon-ch"&gt;&lt;/span&gt;中國&lt;/a&gt;
              &lt;a href="javascript:;" id="Tamil" onclick="translateLanguage(this.id);" class="dropdown-item"&gt;&lt;span class="flag-icon flag-icon-in"&gt;&lt;/span&gt;தமிழ்&lt;/a&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Javascript:</p>
  
  <pre><code>&lt;script&gt;
      $(document).ready(function () {
          $('.dropdown-menu-col a').click(function () {
              $('.current').text($(this).text());
          });
      });
  &lt;/script&gt;
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/YOQcc.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/YOQcc.png" alt="Lang"></a></p>