Skip to content

Instantly share code, notes, and snippets.

@collin
Created September 25, 2008 16:27
Show Gist options
  • Save collin/12850 to your computer and use it in GitHub Desktop.
Save collin/12850 to your computer and use it in GitHub Desktop.
$('div').dblclick(function() {
var el = $(this);
el
.hide()
.after($('<input name="something" type="text">')
.val(el.html())
.blur(function() {
el
.html($(this).val())
.show();
$(this).remove();
$.post(url, jsonData) // more ajax info => http://docs.jquery.com/Ajax/jQuery.post#urldatacallbacktype
}));
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment