Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

1
  • 1
    I would like to highlight (using bounding boxes) MULTIPLE search items. However, imagine the following 2 search items: "The quick" and "quick fox". If I highlight "The quick" by wrapping it, it will become a separate TEXT node and it would make it difficult to find "quick fox". One technique that I'm thinking of is: 1. Temporarily adding a <span /> element. 2. Finding the bounding box of the element (using offset(), width, height). 3. Deleting the above element. 4. Adding a box with the above dimensions to the container. Might work if the text is not wrapped around... Commented Nov 29, 2009 at 19:09