Skip to content

Instantly share code, notes, and snippets.

@neatville
Created September 20, 2014 03:46
Use jQuery replaceWith for easy yet powerful DOM manipulation.
var href = $(".link").attr("href");
var textOf = $(".link").text();
$( "a" ).click(function() {
$( this ).replaceWith( "<textarea autofocus>" + href + " -> " + textOf + "</textarea>" );
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment