JSFiddle - React, Tailwind, and code Playground
by lemon kazi
HTML
<script src="https://mdbootstrap.com/api/snippets/static/download/MDB-Pro_4.19.1/js/jquery.min.js"></script>
<script src="https://mdbootstrap.com/api/snippets/static/download/MDB-Pro_4.19.1/js/mdb.min.js"></script>
<script src="https://mdbootstrap.com/wp-content/themes/mdbootstrap4/js/bundles/4.19.1/compiled-addons.min.js"></script>
<script src="https://mdbootstrap.com/api/snippets/static/download/MDB-Pro_4.19.1/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="https://mdbootstrap.com/api/snippets/static/download/MDB-Pro_4.19.1/css/mdb.min.css">
<link rel="stylesheet" href="https://mdbootstrap.com/api/snippets/static/download/MDB-Pro_4.19.1/css/bootstrap.min.css">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.11.0/css/all.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/country-region-dropdown-menu/1.2.1/geodatasource-cr.min.js"></script>
<select class="mdb-select md-form form-control gds-cr" country-data-region-id="gds-cr-one" multiple searchable="Search here..">
</select>
<button class="btn-save btn btn-primary btn-sm">Save</button>
JavaScript
// Material Select Initialization
$(document).ready(function() {
$('.mdb-select').materialSelect();
//if($('.dropdown-content li:nth-child(3)').hasClass('active')){
//$('.dropdown-content li:nth-child(3)').removeClass('active');
//$('.dropdown-content li:nth-child(3)').addClass('selected');
//$('.dropdown-content li:nth-child(3)').attr('aria-selected',false);
//$('.dropdown-content li:nth-child(3)').hide();
//$(".dropdown-content > li:contains('Please select a country')").hide();
//}
//$("select.gds-cr").find("option:contains('Please select a country')").remove();
//$('.dropdown-content li:nth-child(3)').remove();
//$('.dropdown-content li:nth-child(3)').remove();
$("select.gds-cr").change(function(){
$(".dropdown-content > li:contains('Please select a country')").remove();
$("select.gds-cr").find("option:contains('Please select a country')").remove();
var selectedCountry = $(this).val();
//alert("You have selected the country - " + selectedCountry);
});
console.log($(".dropdown-content > li:contains('Please select a country')").parent());
//$('.dropdown-content li:nth-child(3)').remove();
});