Skip to content

Instantly share code, notes, and snippets.

@ajaswa
Created December 22, 2010 21:59
Show Gist options
  • Select an option

  • Save ajaswa/752161 to your computer and use it in GitHub Desktop.

Select an option

Save ajaswa/752161 to your computer and use it in GitHub Desktop.
var ctaLink = contentDiv.find("a"), // only 1 'saved'
ctaLinkText = ctaLink.text();
// can't do this:
ctaLink.text('');
ctaLink.addClass("arrow-box");
ctaLink.append("<div class='text'>"+ctaLinkText+"</div><div class='arrow'></div>");
ctaLink.clone().appendTo(ctaDiv);
// so this has to happen:
ctaLink.clone().appendTo(ctaDiv).text('').addClass("arrow-box").append("<div class='text'>"+ctaLinkText+"</div><div class='arrow'></div>");
// mainly bitching because I couldn't do what I wanted the way I wanted to...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment