View Full Version : clipboard

12-08-2006, 03:40 PM
I have made a colour chart web page for some students to use to see:

Web safe 219 colours
X11 named colours
VGA 16 named colours
Web Smart (4096 colours)

Each colour is represented by a div which has appropriate bg colour. I have titled each div with the name and HEX value of the colour. This is so when I hold the mouse over a div is tells us the colour values of the div. That great but It would be highly benificial if the students could click the div and the hex value/named value could be written to the clip board.

Is there a script for sending text to the clipboard?

12-08-2006, 05:49 PM
There is a very nifty IE only script if you care for it? Most folks are always looking for something Xbrowser.
Give an example of one of your DIV color tags and I'll whip it up for you.

12-12-2006, 10:33 AM
<div class="cols" style="background-color:#000033;" title="Hex: #000033" onclick="update('000,000,255','0000FF','blue');">&nbsp;</div>

It is the middle parameter in the call to update function. The Hex value


12-12-2006, 04:49 PM
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HEAD><TITLE>put something on the clipboard </TITLE>
<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<STYLE type=text/CSS>

<SCRIPT type="text/javascript">
function update(a,b,c){
Copied = document.getElementById('CB').createTextRange();

<META content="MSHTML 6.00.2900.2963" name=GENERATOR></HEAD>
<input type=hidden ID="CB">
<div class="cols" style="background-color:#000033;" title="Hex: #000033" onclick="update('000,000,255','0000FF','blue');">&nbsp;</div>

<TEXTAREA>test it here</TEXTAREA>


12-15-2006, 03:01 PM
thx :D

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum