Forum Moderators: open

Message Too Old, No Replies

Createrange Help

Retrieve the tags of a text

         

megh

10:49 pm on Jan 27, 2004 (gmt 0)

10+ Year Member



Hi,
I am using document.selection.createRange().text; to retrieve the value of the selected text from a text editing area. My requirement is to retrieve the tags of that text too. Specifically I want to be able te edit the href tag of that text. Is there a way by which i can access the tags along with the text?

Thanks,
Megh

RonPK

1:33 pm on Jan 29, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



document.selection.createRange().htmlText contains the text and the HTML of the selection. You'll have to perform some additional string parsing to retrieve the value of href...

megh

9:55 pm on Jan 29, 2004 (gmt 0)

10+ Year Member



Thats great. Thanks mate.