diff --git a/index.html b/index.html index d4b59a7..b716b41 100644 --- a/index.html +++ b/index.html @@ -259,24 +259,24 @@ -

Below is an example of how you could have two select inputs depend on eachother. 'Boroughs' will only be enabled if - the value of 'States' is 'New York'

- - + + + + + - - + + + + + @@ -475,13 +475,14 @@ shouldSort: false, }); - var states = new Choices(document.getElementById('states')); + var cities = new Choices(document.getElementById('cities')); + var tubeStations = new Choices(document.getElementById('tube-stations')).disable(); - states.passedElement.element.addEventListener('change', function(e) { - if (e.detail.value === 'New York') { - boroughs.enable(); + cities.passedElement.element.addEventListener('change', function(e) { + if (e.detail.value === 'London') { + tubeStations.enable(); } else { - boroughs.disable(); + tubeStations.disable(); } }); @@ -523,7 +524,6 @@ } }); - var boroughs = new Choices(document.getElementById('boroughs')).disable(); });