This demonstrates the use of TextNodeInsertTags() (in conjunction with GetTextNodesByValue()) to search through the document object model (DOM) looking for text nodes that contain the given text string. For each text node that is found, TextNodeInsertTags() inserts a tag around the given substring. You must pass in the text node "objNode", the target text, "strText", and the tag name "strTagName." Optionally, you can pass in an object that contains key-value pairs to initialize the tag. The options structure can be one or two levels deep (a structure containing a structure).
Enter your search text in the field below and click the Search button. That text values of the matching nodes will be displayed the succeeding textarea. Then, the matching substring will be highlighted.
+--- START Test Copy ------------------------+
"I like you exactly the same way as the girls in the movie. I have wanted to tell you that for a long time but did not know how. I guess I was afraid of losing your friendship too."
"But we aren't suppose to like each other that way."
"Who says? If I like you and you like me then it is no one's business but ours, right."
"I guess."
Janet took Karla's hands in hers and squeezed them. This brought a smile to Karla's face.
"What do we do now?" Karla asked.
"Well I don't know about you but I think I would like to kiss you."
"I think I would like that."
Janet slowly moved her head toward Karla's. As their heads got close, Karla closed her eyes. She felt Janet's lips touch hers and she knew this was right. It was a soft kiss only lasting a few seconds.
+--- END Test Copy --------------------------+