hey, i know there's lots of tutorials out there but none seem to be working for me.
I have this :
<textarea name="forum_link" type="text" style="width:630px; height:90px;">
[URL=http://www.site.net/video/<?=$_GET['id']?>/<?=$_GET['tag']?>]<?=$video->title?>[/URL]
[URL=http://www.site.net/video/<?=$_GET['id']?>/<?=$_GET['tag']?>][IMG]<?=$video->thumbnailURL?>[/IMG][/URL]
</textarea>
Now all i want is a simple button, that when clicked copies the text in the textarea to the users clipboard.
Any help would be great :)
Thanks
<textarea id="html" name="html">Some text</textarea>
<input type="button" value="Refresh" onclick="copy_to_clipboard('html');">
<script>
function copy_to_clipboard(id)
{
document.getElementById(id).select();
document.execCommand('copy');
}
</script>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With