Make an element editable using double-click.
Check out the dist
directory to download the needed files and include them on your page.
If you're using this module in a CommonJS environment, you can install it using npm
or yarn
and require
it:
# Using npm
npm install --save jquery-editable
# Using yarn
yarn add jquery-editable
const $ = require("jquery")
$.fn.editable = require("jquery-editable");
$("span.editable-price").editable({
inputHTML: "<input type='number' min='0.01' step='0.01' />",
clickTarget: "parent",
onChange(val, oldVal) {
val = +val;
// ...
}
});
There are few ways to get help:
- Please post questions on Stack Overflow. You can open issues with questions, as long you add a link to your Stack Overflow question.
- For bug reports and feature requests, open issues. 🐛
Make an element editable using double-click.
- Object
opts
: An object containing the following fields:onChange
(Function): The function that will be triggered on change (onChange (newValue, oldValue) => {...}
)inputHTML
(String|jQuery): The HTML of the input to use or the jQuery element itself (default:<input type='text'>
)clickTarget
(String): Ifparent
, the parent element will become the click target.
- jQuery The selected element.
Have an idea? Found a bug? See how to contribute.