I tried with instructions in A5 . but it didnt work. Child dropdown
values are not populated after parent dropdown value manuallt set. See
https://www.tchibo.com.tr/register page that im trying to do.
Here is my code:
var eChange = new Event('change'),
elCountry = document.querySelectorAll('*[id^="cityDropDown_id"]')[0],
elState = document.querySelectorAll('*[id^="districtDropDown_id"]')[0];
// Select country
elCountry.value = 41;
// Trigger country 'change' event
elCountry.dispatchEvent(eChange);
// Select state when it's populated with states
var timer = setInterval(function() {
if (elState.options.length) {
elState.value = 'Afşin';
// Trigger state 'change' event
elState.dispatchEvent(eChange);
// Stop the interval
clearInterval(timer);
}
}, 1000);