how to get text below mouse pointer

Discussion in 'HTML' started by snehal, Apr 18, 2006.

  1. snehal

    snehal Guest

    Hi all

    How can I get the word(text) under mouse pointer from my web page?
    I want to get the exact word under the mouse pointer from an html page
    & send it for further processing.

    I am able to get current position of the mouse pointer on the html
    form...
    But then how to get the text at that position...?
    this text can be from the text box, toolbar, caption of button anything
    from my form


    Thanks & Regards,
    Snehal.
     
    snehal, Apr 18, 2006
    #1
    1. Advertising

  2. snehal wrote:
    > How can I get the word(text) under mouse pointer from my web page?
    > I want to get the exact word under the mouse pointer from an html page
    > & send it for further processing.
    > I am able to get current position of the mouse pointer on the html
    > form...
    > But then how to get the text at that position...?


    google "dhtml text at cursor". You will be rewarded with tons of
    examples.
     
    Travis Newbury, Apr 18, 2006
    #2
    1. Advertising

  3. snehal

    snehal Guest

    google "dhtml text at cursor". No result found
     
    snehal, Apr 18, 2006
    #3
  4. snehal

    Martin Jay Guest

    In message <>,
    snehal <> writes
    >google "dhtml text at cursor". No result found


    "About 690,000 found" when I tried. :)

    Try doing a Google web search.
    --
    Martin Jay
     
    Martin Jay, Apr 18, 2006
    #4
  5. snehal

    David Segall Guest

    "snehal" <> wrote:

    >google "dhtml text at cursor". No result found

    I don't think that he wanted you to include the quotation marks.
     
    David Segall, Apr 18, 2006
    #5
  6. David Segall wrote:
    > "snehal" <> wrote:
    >
    >> google "dhtml text at cursor". No result found

    > I don't think that he wanted you to include the quotation marks.

    Just a word of warning...many are very old JavaScript, that is pre-W3C
    DOM browsers with *great* browser sniffing like:

    if(document.layers){ blah; }
    if(document.all){ blah; }

    and nary a

    if(document.getElementById){ the blah that you should code for; }

    so for the newbie if you do not know what I am talking about then much
    of what you see with above search will not yield much help. I would
    advise using CSS methods

    Google "CSS tooltips" and steer clear of JavaScript solutions.

    --
    Take care,

    Jonathan
    -------------------
    LITTLE WORKS STUDIO
    http://www.LittleWorksStudio.com
     
    Jonathan N. Little, Apr 18, 2006
    #6
  7. snehal

    Guest

    Jonathan N. Little wrote:
    > Google "CSS tooltips" and steer clear of JavaScript solutions.


    I don't believe that's what the OP was after; (s)he wanted to be able
    to "select" a word, say amidst some text, and then feed it to a script.
    I suppose a bit like how you can double-click on a word in a word
    processor and then access a context-sensitive menu for a spell-check or
    whatever.

    I have absolutely no idea how (or why) you'd go about doing it, though.
    One for comp.lang.javascript or similar, perhaps?


    --
    AGw.
     
    , Apr 18, 2006
    #7
  8. wrote:
    > Jonathan N. Little wrote:
    >> Google "CSS tooltips" and steer clear of JavaScript solutions.

    >
    > I don't believe that's what the OP was after; (s)he wanted to be able
    > to "select" a word, say amidst some text, and then feed it to a script.
    > I suppose a bit like how you can double-click on a word in a word
    > processor and then access a context-sensitive menu for a spell-check or
    > whatever.
    >
    > I have absolutely no idea how (or why) you'd go about doing it, though.
    > One for comp.lang.javascript or similar, perhaps?



    Ah, yes I see you are correct by studying OP's initial post. I am fairly
    sure you cannot do what OP wishes with HTML even with JavaScript to
    assist. In fact finding the exact mouse position with respect to the
    document and viewport is a major challenge for cross-browser support

    http://www.quirksmode.org/js/events_properties.html
    Javascript - Event properties

    let alone 'recognizing' what word is where within the flow of the
    document! Where it was varies by browser, viewport size, font size and
    font used by user's system! Maybe some java applet or within a flash
    object but anywhere in a webpage? Don't think it is possible?



    --
    Take care,

    Jonathan
    -------------------
    LITTLE WORKS STUDIO
    http://www.LittleWorksStudio.com
     
    Jonathan N. Little, Apr 18, 2006
    #8
  9. snehal

    snehal Guest

    Hi all,

    Thanks for ur replies
    Is there is any way to get text selected by the user on form.?
    but again the text can be from text box,caption of button, Labels,or
    simple text on form...


    Thanks once again
    Snehal
     
    snehal, Apr 19, 2006
    #9
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Davisro
    Replies:
    2
    Views:
    1,316
    Jim Corey
    Apr 23, 2004
  2. Stefan Mueller
    Replies:
    0
    Views:
    375
    Stefan Mueller
    Jan 28, 2006
  3. Mel
    Replies:
    5
    Views:
    122
  4. Replies:
    1
    Views:
    147
    David Mark
    Oct 2, 2007
  5. kiran
    Replies:
    12
    Views:
    1,128
    Scott Sauyet
    Dec 7, 2011
Loading...

Share This Page