[Project_owners] Cancelling Web page selection

Neil neil at parkwaycc.co.uk
Fri Dec 9 14:25:58 EST 2005

Alex Eng wrote:

> What I want to do is extract all text inside a rich edit box (i.e., an 
> HTML document inside an <iframe> with designMode = "on"), while still 
> keeping line breaks.
> There are other approaches I explored, but they didn't work out:
> - Using the DOM Range methods.  Calling rangeObject.toString() 
> retrieves all the text, but line breaks are lost and the extracted 
> plain text is a garbled mess.

Well, this javascript bookmarklet worked for me on a random web page:
javascript: var range = document.createRange(); 
range.selectNode(document.body); alert(range.toString());

More information about the Project_owners mailing list