How to get the start and end of selected text from iframe in javascript

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • malathib
    New Member
    • Mar 2009
    • 23

    #1

    How to get the start and end of selected text from iframe in javascript

    Hi,

    I am trying to do the following in firefox.Please suggest the solution that will be applicable to firefox only.

    I am having one xml and xslt file. I kept the xml file content in iframe. Now what i want is, when i select the text in iframe and click on bold link, it has to get the selected text start and end and it has to insert <b> beginning and closing tags.

    For example ; This is a text

    If i am selecting the text 'This' from iframe and clicking on Bold, it has to insert <b>This</b>

    Dont ask me to use execCommand. we will not be having any control on that to customize on our own
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    Does this demo help?

    Comment

    Working...