Here are some examples of using Drupal's states API. It shows the use of OR and XOR (which only work with jQuery 1.8 or above, apparently). More examples can be found in the examples project in the form example module.
A nice way to add placeholders to input fields.
"This module auto-converts form input fields with space-hogging labels into compact mobile-friendly input fields, with placeholders that animate into much smaller labels the moment text is keyed in. "
The gist: "This module extends the functionality of the core 'file' field, adding new capabilities to the file upload widget, and providing a new extendible field formatter for displaying lists of files."