Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 972091
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T03:04:00+00:00 2026-05-16T03:04:00+00:00

Sample HTML Data <body style=width:300px;> <h3>Long-Text</h3> A simple tool to store and display texts

  • 0

Sample HTML Data


<body style="width:300px;">
<h3>Long-Text</h3>
A simple tool to store and display texts longer than a few lines.
The search button will highlight all the words matching the name of objects that are members of the classes listed in searchedClasses, itself a member of the KeySet class. The highlighted words are hypertext.
Edit invokes wscripts/acedb.editor, which by default launches emacs. Edit that file to start another editor in its place.
Save will recover from the emacs but will not destroy it.
Read will read a text file, so you could Search it.
**general** grep is a way to annotate a set of longtexts versus the searchedClasses. It outputs an ace file that you can then hand check and read back in acedb to create XREF from longTexts to genes etc.
<h3>World Wide NotePad</h3>
World wide notepad is a small text editor similar to Microsoft's notepad but has some more useful features like an auto typer to make typing the same sentence or word more easy, also World Wide NotePad has a text to speech feature which reads all text in the current open document and speaks it out load to you.
<h3>Etelka Wide Text Pro Bold Italic</h3>
</body>

For example -> “general” (between ** ) is at x=0 and y=465. I know the x,y position. But How to highlight a word located at specific location ?

Let me explain once again. I want to highlight a word by location.

for example I have a location value (x,y)=(0,625). I want to extract the first word by that location ( assume – at that location – we have word “World” ) Then how to highlight that word ?

Edit :
Here Y co-ordinate is absolute position of entire html document.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T03:04:01+00:00Added an answer on May 16, 2026 at 3:04 am

    The only method I can think of involves wrapping every word in a span element, and then using document.elementFromPoint(x,y) to get the span element at the given location. Something like this:

    function highlightWordAtXY(x, y) {
        // Get the element containing the text
        var par = document.elementFromPoint(x, y),
            // textContent or innerText ?
            t = "textContent" in par ? "textContent" : "innerText",
            // Get the text of the element. No pun intended on the par[t].
            text = par[t],
            result;
    
        // Wrap a span around every word
        par.innerHTML = text.replace(/\b(\w+)\b/g, "<span>$1</span>");
    
        // Get the elementFromPoint again, should be a span this time
        result = document.elementFromPoint(x, y);
    
        // Check that we actually clicked on a word
        if (result == par)
            return false;
    
        // Wrap HTML text around the text at x, y
        result[t] = '<span class="highlight">' + result[t] + '</span>';
    
        // Restore the content with the wrapped text
        par.innerHTML = par[t];
    }
    

    Example at http://jsfiddle.net/BSHYp/1/show/light/ – click a word and watch it highlight.

    Some important caveats here:

    • Each block of text must be wrapped in an element (such as <p> or <div>). You should be wrapping paragraphs in <p> tags anyway,
    • The element at the given location (x, y) must only have text in it, no child HTML elements. Text nodes with sibling HTML elements will have them removed (e.g. Clicking “Some” or “here” in Some <b>text</b> here will remove the <b> tags). Dividing them into separate <span> elements would be the only solution without building a much more complex routine,
    • IE will throw an “Unknown runtime error” if you try and add a block level element to a <p> tag,
    • On very, very, very large blocks of text you might run into performance issues. Break them up where applicable.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.