I was looking for an answer to this question, and I came up with this
stackoverflow - How do I select text nodes with jQuery?
Is there so far another way to do this ?? In my very case I'm trying to find every text node starting from a given DOM element and
empty()
it. Any suggestions ?
UPDATE - After a bit of messing I came up with this jsFiddle
Now the function selects each text node but instead of replacing only the empty ones with the new value given, it replaces all of them. What am I doing wrong ??