title: Can I style the alt attribute of an image tag in jquery?
body: <p>I'm using this Jquery function so show a caption above images using the associated alt tag in the html. I'd like to be able to style the text that shows and was wondering if there is a way to do this. Here is the code I'm using.</p>
  
  <pre><code>$(function () {
      var show = false;
      $(".thumb").mouseenter(function () {
          var $t = $(this);
          var $d = $("&lt;div&gt;");
          $d.addClass("desc").text($t.attr("alt")).css({
              width: $t.width(),
              height: $t.height() - 20,
              top: $t.position().top
          });
          $t.after($d).fadeTo("fast", 0.3);
          $d.mouseleave(function () {
              $(this).fadeOut("fast", 0, function () {
                  $(this).remove();
              }).siblings("img.thumb").fadeTo("fast", 1.3);
          });
      });
      $('#caption-toggle').click(function() {
          if (!show) $('.thumb').trigger('mouseenter');
          else {
              $('.thumb ~ div').fadeOut("fast", 0, function () {
                  $(this).remove();
              }).siblings("img.thumb").fadeTo("fast", 1.0);
          }   
          show = !show;
      });
  });
  </code></pre>
  
  <p>Most people have answered no to similar questions on this site, but I wanted to ask for myself to make sure whether this is possible or not. Cheers!</p>