I have to create a dynamic drop down using AEM 6.4 where States need to be populated based on the Country Selected and it must be authorable.
I have used the below code where if the part is not working. Can anyone guide in reading the country value?
<body>
<div id="country">${properties.country}</div>
<div id="usaStates">${properties.usastates}</div>
<div id="indianStates">${properties.indianstates}</div>
<script>
var countryName=document.getElementById("country").innertext;
if(countryName=="India")
{
document.getElementById("usaStates").style.visibility = "hidden";
}
else
{
document.getElementById("indianStates").style.visibility = "hidden";
}
</script>
</body>