Jump to content

Copy to clipboard


karimali831

Recommended Posts

Hi,

 

This below script selects all text when you click.

Is it possible to automatically copy the text to clipboard or use a button/link or something to show copy to clipboard?

 

<script type="text/javascript">
function SelectAll(id)
{
    document.getElementById(id).focus();
    document.getElementById(id).select();
}
</script>

<input type="text" id="txtfld" onClick="SelectAll('txtfld');" style="width:200px" value = "This text you can select all" />

 

Thanks for any help

Link to comment
https://forums.phpfreaks.com/topic/217291-copy-to-clipboard/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.