javascript - copy content from textbox by click button -


it such have textbox have content in, , when click button clicks copies content in textbox itself, should not such have run mouse on copy it. has when click on button copies themselves.

i have try here:

<asp:textbox id="textboxhenvis" cssclass="form-control input-lg" runat="server" readonly="true"></asp:textbox><br />             <asp:button id="buttonkopier" runat="server" text="kopier link" onclientclick="copytoclipboard()" cssclass="btn btn-success" /> 

javascript here

function copytoclipboard()      {          var controlvalue  = document.getelementbyid('<%=textboxhenvis.clientid%>').value;         alert(controlvalue);     } 

this means in other words should download content , when click ctrl + v throw content got click button.

function copytoclipboard() {     holdtext.innertext = copytext.innertext;     copied = holdtext.createtextrange();     copied.execcommand("copy"); } 

Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -