Thursday, January 3, 2008

Retrieving Selected Text Using Javascript

function copy()

{

var selectedText = document.selection;

if (selectedText.type == 'Text')

{

var newRange = selectedText.createRange();

form1.txtTest.focus();alert(newRange.text)}else{alert('Please Select The Text');

}}