1.0.2 • Published 6 years ago

copy-simple v1.0.2

Weekly downloads
3
License
ISC
Repository
github
Last release
6 years ago

copy.js

copy-simple.js is a painless copy helper for JavaScript.

Usage

There are different functions to copy values. All methods will return true or false;

import the library

import copy from 'copy-simple';

Copy Element Value - val()

<input id="testVal" type="text" value="Test 2-3-4">
var copiedValue = copy("#testVal").val()

Copy Element Text - text()

<div id="test">Test Content</div>
var copiedText = copy("#test").text()

Copy Element HTML - html()

<div id="test2">Test Content2</div>
var copiedHtml = copy("#test2").html()

Copy Current URL - url()

var copiedUrl = copy().url()

Copy Selected Text - selected()

<div>My Text</div>
var copiedSelected = copy().selected()