New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

instaedit

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

instaedit

A javascript plugin for in-place text editing

latest
Source
npmnpm
Version
1.1.0
Version published
Maintainers
1
Created
Source

InstaEdit

Javascript plugin to edit any element in-place

  • Convert any text element to editable
  • No dependencies required
  • Easy to use

Usage

Include instaedit.js in your project.

<script src="instaedit.js"></script>

Via data attribute

<div data-instaedit="handleResult" class="instaedit">
    Click to Edit Me
</div>
// Creating new instance of InstaEdit
var instaedit = new InstaEdit();
instaedit.init();

// Function used to handle value after editing
function handleResult(val) {
    console.log(val);
}

Using javascript

<h1 id="story-title">Editable Story Title</h1>
// Getting reference to #story-title
var title = document.getElementById('story-title');

// Creating new instance of InstaEdit
var instaedit = new InstaEdit();

// Adding #story-title to instaedit
instaedit.add(title, function(val) {
    console.log(val);
});

Keywords

in-place

FAQs

Package last updated on 13 Apr 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts