Category: add events to dom

JavaScript Refactoring Techniques: Specific to Generic Code

In a recent thread on SitePoint’s forums, some code was given to let one dropdown box control when another dropdown box is visible. Even though the code worked just fine, I realized that it left much to be desired. It was brittle and incapable of withstanding even small changes to the accompanying HTML. Here is t...