To show country flag like below in Jquery dropdown you can follow below steps.
Download Country Select plugin https://www.jqueryscript.net/form/country-picker-flags.html
- <link href="~/Content/countrySelect.min.css" rel="stylesheet" />
- <script src="~/Scripts/jquery-3.4.1.min.js"></script>
- <script src="~/Scripts/countrySelect.min.js"></script>
- <form>
- <div>Selector Plugin</div>
- <div class="form-item">
- <input id="country_selector" type="text">
- </div>
- <div class="form-item" style="display:none;">
- <input type="text" id="country_selector_code" name="country_selector_code" data-countrycodeinput="1" readonly="readonly" placeholder="Selected country code will appear here" />
- </div>
- </form>
- <script>
- $("#country_selector").countrySelect({
- preferredCountries: ['ind', 'pak', 'aus']
- });
- </script>
Post a Comment