| Author |
Highlight the search keyword
|
Soumya Manjunath
Ranch Hand
Joined: Nov 28, 2007
Posts: 34
|
|
Guys,
I'm developing a Search functionality in a page where in I need to highlight the search keyword criteria.
Could somebody please explain me how to achieve this/point me to good examples.
|
Thanks & Regards,<br />Soumya.
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56204
|
|
|
Apply CSS styles to the highlighted text.
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
William Brogden
Author and all-around good cowpoke
Rancher
Joined: Mar 22, 2000
Posts: 12269
|
|
Are you asking about how to highlight (display style) or how to locate the words in the text in the first place (parsing) in order to apply the style.
Bill
|
Java Resources at www.wbrogden.com
|
 |
Soumya Manjunath
Ranch Hand
Joined: Nov 28, 2007
Posts: 34
|
|
Thanks for the reply Guys.
Yes Bill, I would like to know how to locate the words in the text and then how to highlight them.
|
 |
Sean Clark
Rancher
Joined: Jul 15, 2009
Posts: 377
|
|
Hey,
I was thinking about doing the same thing, although I haven't got round to implementing it. I would use a Regular Expression to find the work you are searching for capture it and replace with the same text surrounded by some kind of css class: e.g.
Then add some style to highlight.
Sean
|
I love this place!
|
 |
Soumya Manjunath
Ranch Hand
Joined: Nov 28, 2007
Posts: 34
|
|
|
Thanks.Let me try that!
|
 |
 |
|
|
subject: Highlight the search keyword
|
|
|