"use strict";

document.addEventListener("DOMContentLoaded", function(){
    /* js to be executed when dom is loaded goes here */
    
      let iceCreamOptions = document.getElementById("icecream_options_v2");
      let wantRadioButtons = document.querySelectorAll("form input[name=want]");

      let icoClasses = iceCreamOptions.classList;
      icoClasses.add("collapsed");

      for (let radio of wantRadioButtons) {
        radio.addEventListener("click",function(){
          let yesRadio = document.getElementById("ic_yes");
          if (yesRadio.checked == true) {
            icoClasses.remove("collapsed");
          } else {
            icoClasses.add("collapsed");         }
        })
      }

    });
    
    