Q: Javascript counting all the characters from a HTML document I have been given a strange problem to solve as homework. Here it is:

Write a javascript which counts all the letters from the text in an html document. The text from inside all DIV, SPAN, P, A, TABLE tags should be considerred. You are not allowed to use any CSS code for this. In addition, the javascript code should consider all the text from the document as a huge string and create 2 new divs: one containing the characters from odd positions in this string and another containing the characters from even positions; this huge string should also be printed/written separately in the document. 

I have looked on w3schools and javascript tutorial sites, but I couldn't find a javascript function which accesses a given document and which counts the characters from that document.
Can you help me?

A: Here is a way to get the "huge string" from your document.
var hugeString = document.body.textContent;

Now its your turn to create divs which has odd and even characters.
