Skip to content

Instantly share code, notes, and snippets.

@raulsouzalima
Created March 23, 2010 21:16
Show Gist options
  • Save raulsouzalima/341665 to your computer and use it in GitHub Desktop.
Save raulsouzalima/341665 to your computer and use it in GitHub Desktop.
// Editar título bloco
$(".click_edit").click(function() {
var obj = $(this);
var text = obj.text();
obj.html('<input type="text" value="" class="test" />');
obj.find('.test').focus().select();
obj.find('.test').blur(function() {
var replace_field = $(this).val();
if (replace_field == '')
replace_field = text;
obj.html(replace_field);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment