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 - How to save instance state of selected radiobutton on menu -

python 3 IndexError: list index out of range -

IF statement in MySQL trigger -