# Help needed for replacing selected text

**URL:** <https://forum.kirupa.com/t/help-needed-for-replacing-selected-text/58551>\
**Category:** web dev\
**Created:** [July 23, 2004, 2:02pm UTC](https://forum.kirupa.com/t/help-needed-for-replacing-selected-text/58551 "2004-07-23T14:02:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![santhosh](https://avatars.discourse-cdn.com/v4/letter/s/f07891/32.png) [@santhosh](https://forum.kirupa.com/u/santhosh)\
**Post date:** [July 23, 2004, 2:02pm UTC](https://forum.kirupa.com/t/help-needed-for-replacing-selected-text/58551/1 "2004-07-23T14:02:21Z")

</div>

Dear All,

```
     I am using a Netscape Navigator.

     I am using a Javascript function which should get selected object from the document and replace the same with my new content in the IFRAME with a TextArea.

     I am able to get the Selected Text by using document.getSelection() method.

```

But how do i replace the selected text with my new content.

Thanks in advance for the replies.

Thanks and Regards,  
Santhosh Kumar.M
