Skip to content

Instantly share code, notes, and snippets.

@cnix
Created October 28, 2008 16:34
Show Gist options
  • Save cnix/20418 to your computer and use it in GitHub Desktop.
Save cnix/20418 to your computer and use it in GitHub Desktop.
$('.btn').each(function(){
var b = $(this);
var tt = b.html() || b.val();
if ($(':submit,:button',this)) {
b = $('<a>').insertAfter(this). addClass(this.className).attr('id',this.id);
$(this).remove();
}
b.text('').css({cursor:'pointer'}). prepend('<i></i>').append($('<span>'). html(tt).append('<i></i><span></span>'));
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment