click: function(event, data) {
$('#clicked-state')
.text('You clicked: '+data.name);
if (data.name == "VA") {
$('#va').toggle();
}
else {
$('#va').style.display = 'none';
}
}
});
In the scenario described above, when a state other than 'VA
' is clicked, the VA
div will be hidden. Currently, clicking on 'VA
' toggles the visibility of the VA
div. However, if you click on a different state, the VA
div remains visible. It should actually be hidden!