function update()
{
var albania = ["Tirana","Durres","Vlore","Shkoder"];
var kosovo = ["Prishtina","Mitrovica","Peje","Gjakove"];
var germany = ["Berlin","Frankfurt","Hannover","Bonn"];
var countries = document.getElementById("1");
var cities = document.getElementById("2");
var selected = countries.options[countries.selectedIndex].value;
if(selected=="1"){
for(var i = 0; i < albania.length; i++) {
var opt1 = document.createElement('option');
opt1.innerHTML = albania[i];
opt1.value = albania[i];
cities.appendChild(opt1);
}
}
else if(selected=="2")
{
for(var j = 0; j < kosovo.length; j++) {
var opt2 = document.createElement('option');
opt2.innerHTML = kosovo[j];
opt2.value = kosovo[j];
cities.appendChild(opt2);
}
}
else if(selected=="3")
{
for(var k = 0; k < germany.length; k++) {
var opt3 = document.createElement('option');
opt3.innerHTML = germany[k];
opt3.value = germany[k];
cities.appendChild(opt3);
}
}
else
var t =1;
}
function enableButton()
{
var selectelem = document.getElementById("1");
var selectelem = document.getElementById("2");
var btnelem = document.getElementById('seedoc');
btnelem.disabled = !selectelem.value;
}
._junci2 {
display: grid !important;
grid-template-columns: 1fr 1fr !important;
grid-column: 2 / auto !important;
}
._16scnk6 {
width: max-width !important;
font-family: NeoSansStd !important;
font-size: 40px !important;
font-weight: normal !important;
font-style: normal !important;
font-stretch: normal !important;
color: white !important;
}
._9z45d9 {
width: max-width !important;
font-family: NeoSansStd !important;
font-size: 40px !important;
font-weight: 800 !important;
font-style: normal !important;
font-stretch: normal !important;
color: white !important;
}
._d2tanu {
-webkit-box-direction: normal !important;
-webkit-box-orient: vertical !important;
-ms-grid-column: 1/2 !important;
grid-column: 1/2 !important;
-ms-grid-row: 1/2 !important;
grid-row: 1/2 !important;
display: -webkit-box !important;
display: -moz-box !important;
display: -ms-flexbox !important;
display: -webkit-flex !important;
display: flex !important;
-webkit-flex-direction: column !important;
-ms-flex-direction: column !important;
flex-direction: column !important;
}
._c5ng95 {
margin-top: 100px !important;
grid-column: 1 / auto !important;
grid-row: 1 / auto !important;
}
._1nbb27e {
margin-top: 100px !important;
grid-column: 2 / auto !important;
grid-row: 1 / auto !important;
}
._rn61mg {
-webkit-box-pack: center !important;
display: grid !important;
justify-content: center !important;
margin-top: 200px !important;
grid-row: 1 / auto !important;
grid-column: 1 / 3 !important;
}
._woxk45 {
-webkit-box-pack: center !important;
display: grid !important;
justify-content: center !important;
text-align: justify !important;
margin-top: 250px !important;
grid-row: 1 / auto !important;
grid-column: 1 / 3 !important;
}
._koh25r {
-webkit-box-pack: center !important;
display: grid !important;
justify-content: center !important;
background-image: url(http://34.206.138.179.xip.io/kerala/wp-content/uploads/sites/19/2019/09/mapBackground.390109a9.png) !important;
background-size: 100% !important;
grid-template-columns: 30% 30% !important;
grid-template-rows: 700px !important;
grid-column: 1 / 3 !important;
grid-row: 2 / auto !important;
background-repeat: no-repeat !important;
background-position: inherit !important;
gap: 30px !important;
}
.modal-body {
position: relative;
flex: 1 1 auto;
padding: 1rem;
}
button:disabled,
button[disabled]{
background-color: #cccccc;
color: #666666;
pointer-events: none;
}
._8qcrlz {
display: block !important;
font-size: 16px !important;
color: rgb(102, 102, 102) !important;
line-height: 1 !important;
width: 100% !important;
max-width: 100% !important;
box-sizing: border-box !important;
box-shadow: rgba(0, 0, 0, 0.04) 0px 1px 0px 1px !important;
-webkit-appearance: none !important;
background-color: rgb(255, 255, 255) !important;
background-image: url(C:\Users\pavan.k\Desktop\download.png) !important;
background-size: 0.65em, 100% !important;
padding: 0.6em 1.4em 0.5em 0.8em !important;
border-width: 1px !important;
border-style: solid !important;
border-color: rgb(170, 170, 170) !important;
border-image: initial !important;
background-repeat: no-repeat, repeat !important;
background-position: right 0.7em top 50%, 0px 0px !important;
}
._12l1t1d {
height: 15px !important;
object-fit: contain !important;
font-size: 15px !important;
line-height: 1.47 !important;
letter-spacing: 0.6px !important;
text-align: left !important;
color: rgb(21, 69, 133) !important;
}
button {
background-color: green;
text-align: center;
padding: 5px 10px;
outline: none;
border: none;
width: 106px;
height: 38px;
}
button a {
color: #fff;
}
<div class="_koh25r"><div class="_c5ng95"><label class="_12l1t1d">Select Country</label><select class="_8qcrlz" id= "1" onchange="update()" onchange="enableButton()"><option selected = "selected"><label class="_12l1t1d">Select Country</label></option><option value="1">albania</option><option value="2">kosovo</option><option value="3">germany</option></select></select></div><div class="_1nbb27e"><label class="_12l1t1d">Select Language</label><select class="_8qcrlz" id="2" onchange="enableButton()"><option selected = "selected">select language</option></select></div><div class="_rn61mg"><button id="seedoc" disabled value="submit"><a href="http://34.206.138.179.xip.io/kerala/">submit</a></button></div>
When I selected India it's showing Indian languages and when selected Bangladesh it's again Showing India and Bangladesh Both Languages.
I have an other issue in this code. When we un-selected country or language the button will be hidden.