+ 3
Why is my code giving output 5 instead of 2?
2 ответов
+ 6
Same question asked and answered just today. There are 2 paragraph elements, plus 3 blank text element - before and after first paragraph, and one after the second paragraph.
https://www.sololearn.com/Discuss/2326512/?ref=app
+ 4
To add to Ipang 's answer: to get output of 2, use a.children instead of a.childNodes