Socket
Book a DemoInstallSign in
Socket

on-select

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

on-select

invoke a callback when a user selects some text

latest
Source
npmnpm
Version
1.1.0
Version published
Maintainers
1
Created
Source

on-select

Invoke a callback on user selection. This is a fork of yields/on-select.

Installation

Install with Duo, Component, or NPM.

$ npm install on-select

Example

var onselect = require('on-select');
var unbind = onselect(el, selected);

function selected(e){
  console.log(e);
  unbind();
}

API

onselect(el, fn)

Invoke fn(e, str) when a user selects within el.

str is the user selected text.

License

MIT

Keywords

selection

FAQs

Package last updated on 01 Feb 2015

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