On Aug 31, 11:45 am, Francesca Baslen <francesca.bas...@gmail.com>
wrote:
> var myString = currentNode.getElementsByTagName("A")[0].innerHTML;
> alert(myString);
[quoted text clipped - 3 lines]
>
> But instead it stores: Page1, i.e. the text content of the node.
The key word is "inner". The HTML inside the element. The element
isn't inside itself and isn't included.
Generally I suggest avoiding innerHTML entirely and sticking to DOM
methods instead.
--
David Dorward
http://dorward.me.uk/
http://blog.dorward.me.uk/
Francesca Baslen - 31 Aug 2007 12:56 GMT
David Dorward was caught writing:
> On Aug 31, 11:45 am, Francesca Baslen <francesca.bas...@gmail.com>
> wrote:
[quoted text clipped - 17 lines]
> http://dorward.me.uk/
> http://blog.dorward.me.uk/
Ha, thanks David! You're right of course.
Stick to the DOM I will from now on.
I'll write some reusable code in order to parse the nodes, the
attributes, the inner content, and build the output string.
F.