Archive for the ‘css classes’ Category

Quick Tip: Add or Remove a CSS Class with Vanilla JavaScript

Posted on: No Comments
Sometimes you need to add or remove a CSS class with JavaScript, and you don't want to include an entire library like jQuery to do it. This is useful in situations when you want your page elements to change in response to user actions. Example uses i...

JavaScript Refactoring Techniques: Specific to Generic Code

Posted on: No Comments
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 withs...