[Javascript] Select in Text Area ?

Peter Brunone peter at brunone.com
Sat Nov 8 13:37:09 CST 2003


Tim,

	Something like this should work for IE 4 and up:


function TextRangeSelect() {
	var r = document.formName.textAreaName.createTextRange();
	r.findText("fishes");
	r.select();
}

-----Original Message-----
From: javascript-bounces at LaTech.edu
[mailto:javascript-bounces at LaTech.edu] On Behalf Of Tim Makins

Is it possible to select a section of the text in a text area ?

For example, select 'fishes' in the following sentence 'Of all the
fishes in the sea, the mermaid is the one for me.'

Tim in Ireland.





More information about the Javascript mailing list