javascript - ZeroClipboard issue -


i trying copy link of current page using zeroclipboard , don't know further. code until now. how can copy link?

function copylink() {    document.getelementbyid("copy").value += window.location.href;    var link = document.getelementbyid("copy").value;    var client = new zeroclipboard();    client.settext(link);  }
<script src="https://cdnjs.cloudflare.com/ajax/libs/zeroclipboard/2.2.0/zeroclipboard.core.min.js"></script>  <html>    <head>    <title>copy</title>  </head>    <body>    <div>      <button id="copybtn" onclick="copylink()">copy link</button>      <textarea id="copy" style="display: none;"></textarea>    </div>  </body>    </html>

thanks !


Comments

Popular posts from this blog

javascript - Chart.js (Radar Chart) different scaleLineColor for each scaleLine -

apache - Error with PHP mail(): Multiple or malformed newlines found in additional_header -

java - Android – MapFragment overlay button shadow, just like MyLocation button -