Skip to content

Make an element editable using double-click.

License

Notifications You must be signed in to change notification settings

Bloggify/jquery-editable

Folders and files

NameName
Last commit message
Last commit date

Latest commit

c4c4095 ยท Oct 20, 2024

History

7 Commits
Oct 20, 2024
Oct 20, 2024
Oct 20, 2024
Oct 20, 2024
Oct 20, 2024
Oct 20, 2024
Oct 20, 2024
Oct 20, 2024
Oct 20, 2024
Oct 20, 2024

Repository files navigation

jquery-editable

Version Downloads

Make an element editable using double-click.

โ˜๏ธ Installation

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

๐Ÿ“‹ Example

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;
        // ...
    }
});

โ“ Get Help

There are few ways to get help:

  1. Please post questions on Stack Overflow. You can open issues with questions, as long you add a link to your Stack Overflow question.
  2. For bug reports and feature requests, open issues. ๐Ÿ›

๐Ÿ“ Documentation

jqueryEditable(opts)

Make an element editable using double-click.

Params

  • 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): If parent, the parent element will become the click target.

Return

  • jQuery The selected element.

๐Ÿ˜‹ How to contribute

Have an idea? Found a bug? See how to contribute.

๐Ÿ“œ License

MIT ยฉ Bloggify