Let's Improve on the Ice Cream Example

  1. DRY (Don't Repeat Yourself). Instead of selecting input elements separately and adding 'click' listener to each one, can we select the input elements and loop through them?
    Granted, this is somewhat minor, but it is always good to keep "DRY" in mind.
  2. Progressive Enhancement with JS. Let's practice 'progressive enhancement' and use JavaScript to set things up.
    This means we'll have JS hide the options. If, for some reason, JS is broken, then the whole form will be displayed and can be used.
  3. Control presentation through classes, not individual style properties.
    Let's use a class name that controls whether the ice cream options are displayed.