Hello, Normally when you go to voucher websites, they make you click on a button to copy the voucher code to your clipboard and whilst clicking, the website will open in a new window. I am looking for this sort of Javascript. Thanks.
Hi, I have seen that before but not looking for that sort of thing. I want a button where it says Copy or press here and then copy's another piece of text which the user cant see.
<script tye="text/javascript"> function ClipBoard() { holdtext.innerText = 'TEXT TO COPY'; Copied = holdtext.createTextRange(); Copied.execCommand("Copy"); } </script> Code (markup):
execCommand only works for Internet Explorer. If you want a method that works across all browsers, try Zeroclipboard