copy-simple.js is a painless copy helper for JavaScript.
There are different functions to copy values. All methods will return true or false;
npm i copy-simpleimport copy from 'copy-simple';<input id="testVal" type="text" value="Test 2-3-4">var copiedValue = copy("#testVal").val()<div id="test">Test Content</div>var copiedText = copy("#test").text()<div id="test2">Test Content2</div>var copiedHtml = copy("#test2").html()var copiedUrl = copy().url()<div>My Text</div>var copiedSelected = copy().selected()