Loop through text nodes inside a div
Posted
by crosenblum
on Stack Overflow
See other posts from Stack Overflow
or by crosenblum
Published on 2010-03-26T17:32:07Z
Indexed on
2010/03/26
17:43 UTC
Read the original article
Hit count: 411
I am trying to do a text replace, but to do so, i need to loop through the text nodes of a div.
Each Div upon clicking, loads via ajax it's appropriate content. But then I need to do text-replacing inside any of the text nodes inside there.
My current code, after loading the ajax content, loops through all text nodes of the whole page, and therefore is too resource intensive.
I have been looking for hours trying to find out how to both loop thru a div, and get the text nodes...
and this has to work in firefox, google chrome and ie6.
Any thoughts or suggestions?
© Stack Overflow or respective owner