Skip to content

Instantly share code, notes, and snippets.

@victorjonsson
Last active October 12, 2015 04:58
Show Gist options
  • Save victorjonsson/3974106 to your computer and use it in GitHub Desktop.
Save victorjonsson/3974106 to your computer and use it in GitHub Desktop.
jQuery plugin that makes any HTML element editable
This plugin has moved to
https://github.com/victorjonsson/jquery-editable
@victorjonsson
Copy link
Author

$('#some-element').editable(); // Makes it editable on double click

$('#some-element').editable(function(data) {}); // Add callback with info about potentially changed text and font size

$('#some-element').editable(function(data) { }, 'click'); // Changes the event trigger from double click to ordinary click

$('#some-element').editable( 'destroy' ); // Removes the text editor

$('#some-element').on('edit', function(event, $textArea) { }); // Listen to when a elements gets edited

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment