add custom tags to text

Discussion in 'JavaScript' started by firefoxguy, Apr 27, 2006.

  1. #1
    Hi all,

    I'm creating a firefox extention where i want to highlight some text when the user selects it.

    Now i am able to grab the selected text using

    window.getSelection() method

    but i dont know how to add html tags to this text in order to keep this text highlighted.

    Any help would be great
     
    firefoxguy, Apr 27, 2006 IP
  2. dexfantasy

    dexfantasy Peon

    Messages:
    15
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Not sure how to do this but you may want to check out

    https://addons.mozilla.org/extensions/moreinfo.php?id=791

    From what you are describing, it sounds like this extension already does what you want. If it's not to convoluted, you can sift through the XPI for the code you need.

    Good luck,

    Dex
     
    dexfantasy, Apr 28, 2006 IP
  3. firefoxguy

    firefoxguy Guest

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thanks for that, It really helped me a lot
     
    firefoxguy, Apr 30, 2006 IP