Return to Snippet

Revision: 13590
at April 28, 2009 17:57 by dougunderscorenelson


Initial Code
$("button, .button").each(function() {
  var hasSpan = $(this).find("span")[0];
  if (hasSpan = "undefined") {
    $(this).wrapInner("<span></span>");
  }
});

Initial URL

                                

Initial Description
Quick script to find button elements (and elements with the "button" class) and wrap their innards in spans. Good for making rounded-corner buttons.

Initial Title
Wrap the insides of Buttons

Initial Tags
jquery, button

Initial Language
jQuery