119
rated 0 times
[
124]
[
5]
/ answers: 1 / hits: 17060
/ 8 Years ago, wed, march 9, 2016, 12:00:00
i wrote Javascript that copies the data from textbox to the clipboard:
TextBox:
<asp:TextBox ID=contNoTxtBox runat=server Width=182px style=height: 22px></asp:TextBox>
Javascript:
function CopyToClipBoard()
{
var text = document.getElementById('contNoTxtBox').innerHTML;
window.clipboardData.setData('Text', text);
}
and i call it in HTML button the following way:
<input id=CopyButton type=button value=Copy onclick=CopyToClipBoard() /><br />
However i get the following error:
Uncaught TypeError: Cannot read property 'setData' of undefined
Why am i getting this type pf error?
More From » c#