Código :
<SCRIPT LANGUAJE='JavaScript'> function url2() { var selectedHtml=(document.selection.createRange()).htmlText; // Set the clipboard with selected HTML, if there is any if(selectedHtml!= "") window.clipboardData.setData("Text",selectedHtml); txt= selectedHtml; if (txt!=null) { if (txt == "") { AddTxt="<a href="+txt+"></a>"; AnadeTexto(AddTxt); } else { AddTxt="<a href='entrada.php?entrada="+txt+"'>"+txt+"</a>"; AnadeTexto(AddTxt); } } } function AnadeTexto(Which) { if (document.post.texto.createTextRange) { document.post.texto.focus(); document.selection.createRange().duplicate().text = Which; } else { document.post.texto.value += Which; } } </script>
Código :
<a href="javascript:url2()">Linkar</a>
Gracias de antemano
