views:

74

answers:

2

I am generating a page which renders a list of linkbuttons and labels. Now I want a javascript that parses the inner text of these controls and makes bold those with keywords that match like Google does while rendering a list of websites with linkbutton and its description.

How should i proceed ?

+1  A: 

This should get you started: http://www.nsftools.com/misc/SearchAndHighlight.htm

Aaron Digulla
+1  A: 

To get the collection of link buttons and label elements use getElementsByTagName, then iterate through the collection and use the innerHTML property to access the content within them and match against your keywords. Then for the matching elements set the style.fontweight property to bold.

Dave Anderson
can u please explain it a little bit more with some code.
Maddy.Shik
what specifically do you need help with? Search Google for the keywords; getElementsByTagName, innerHTML and style.fontweight. I would suggest that you really need to understand the DOM of a web page before attempting this.
Dave Anderson