Hello there,

I need some help here in finding out how many characters the first
character of a given node is offset from a parent node. In the
simplest case, for the following:

<div id="root">Hello<span>world!</span></div>

I want a way to figure out that the "w" in the span is offset from the
div by 5 characters.

I attempted at DOM traversal and finding the .text() property of each
node leading upto the target node and then summing up the length of
all the texts...but it was sort of beyond me to get that working.

I would appreciate any help with regard to this.. is there any easier
way to achieve this.

Regards,
Kishore.

Reply via email to