SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Evangelist goughb's Avatar
    Join Date
    Sep 2000
    Location
    Chicago
    Posts
    526
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    Ok, if you have a text area and the user has highlighted some 4 words or whatever. Is it possible to grab the string of the 4 words that are highlighted? I know you can grab the info in the field but, can you grab only a selection of that field?

    Thank You,

    Brett

  2. #2
    SitePoint Wizard creole's Avatar
    Join Date
    Oct 2000
    Location
    Nashvegas Baby!
    Posts
    7,845
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    it's GOT to be possible. I remembered something like this on the Google.com site. SO I downloaded their "Google.com" bar. If I do a search using their bar, I can click the "highlight" button and all instances of my search text are highlighted in yellow on the screen...IN REAL TIME!
    Adobe Certified Coldfusion MX 7 Developer
    Adobe Certified Advanced Coldfusion MX Developer
    My Blog (new) | My Family | My Freelance | My Recipes

  3. #3
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes but only with IE.

    The way:

    Code:
    var selection = document.selection.createRange();
    Please don't PM me with questions.
    Use the forums, that is what they are here for.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •