Automatic image captions with jQuery

This is a quick jQuery snippet to create image captions from alt attributes. Don't forget to include jQuery for this to work.

Instructions

  1. Add jQuery and the JavaScript in the example below
  2. Add class="caption" to your image
  3. Write description in image alt attribute