Clipboard Function

A

Aaron Crouch

I am working on a system to where I could click a button and it would
insert text into the clipboard and add a timestamp. The problem I am
running into is that I can not seem to incoporate variables. This is
three segements of the program. How would I incorporate the
todaystring into the text range being copied.

var today=new Date()
var todayh=today.getHours()
var todaymin=today.getMinutes()
var todaysec=today.getSeconds()
var todaystring=todayh+":"+todaymin+":"+todaysec

function ClipBoard1()
{
holdtext.innerText = copytext.innerText;
Copied = holdtext.createTextRange();
Copied.execCommand("Copy");
}

<SPAN ID="copytext1"
STYLE="height:20;width:400;background-color:#041943">
<font color="#041943">text i want copied. </font></SPAN>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,677
Members
48,796
Latest member
Greg L.

Latest Threads

Top