Cita:
Iniciado por Panino5001 Te toca trabajar un poco a vos, no te parece? ;)
Hasta que me salio:
Código HTML:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>test</title>
<script>
function seleccionar(obj){
if(obj.nodeName.toLowerCase()=='textarea' || (obj.nodeName.toLowerCase()=='input' && obj.type=='text')){
obj.select();
return;
}
if (window.getSelection) {
var sel = window.getSelection();
var range = document.createRange();
range.selectNodeContents(obj);
sel.removeAllRanges();
sel.addRange(range);
}
else if (document.selection) {
document.selection.empty();
var range = document.body.createTextRange();
range.moveToElementText(obj);
range.select();
}
}
</script>
<script type="text/javascript">
function CopyToClipboard()
{
CopiedTxt = document.selection.createRange();
CopiedTxt.execCommand("Copy");
}
</script>
</head>
<body>
<p><a href="#" onclick="seleccionar(document.body); CopyToClipboard();">Seleccionar&Copiar</a></p>
<p> </p>
</body>
</html>