This demonstrates the use of GetTExtNodesByValue() to search through the document object model (DOM) looking for text nodes that contain the given text string. All that is required is the target string argument "strText". As an option, you can pass a root DOM node to start with "objNode." If you do not provide this node, the function will default to the BODY tag and search everything within it. Currently, the search is case insensitive. It will match uppercase and lowercase versions of the target string. The method will return an array of nodes. If no matching text nodes were found, the method will return an empty array.
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. Note that the BOLD tag in the first paragraph splits that paragraph into three separate nodes (two text nodes and a strong element).
+--- 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 --------------------------+