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>
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>