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?