JSFiddle - React, Tailwind, and code Playground

http://stackoverflow.com/questions/16553075/colorbox-add-alt-text-to-gallery-images/

HTML

<script src="http://www.jacklmoore.com/colorbox/jquery.colorbox.js"></script>
<link rel="stylesheet" href="http://www.jacklmoore.com/colorbox/example1/colorbox.css">
<p><a class="group1" href="http://www.jacklmoore.com/colorbox/content/ohoopee1.jpg" title="Me and my grandfather on the Ohoopee.">Grouped Photo 1</a></p>
<p><a class="group1" href="http://www.jacklmoore.com/colorbox/content/ohoopee2.jpg" title="On the Ohoopee as a child">Grouped Photo 2</a></p>
<p><a class="group1" href="http://www.jacklmoore.com/colorbox/content/ohoopee3.jpg" title="On the Ohoopee as an adult">Grouped Photo 3</a></p>

JavaScript

$(function(){
    $('a.group1').each(function(){
        $(this).attr('alt', this.title?this.title:'');
        $(this).attr('alt', this.title2?this.title2:'');
    });
    $("a.group1").colorbox({rel:'group1'});
    //alert(document.documentElement.innerHTML); // test
});