Oh I know! I realised that later on when I reviewed the code but I gave up worrying about demonstrating the speed of DOM access* when it started to crash my browser! So I've left this version here for posterity.
* I wanted to demo to some people why it's better to write javascript that avoids going back and forth to the DOM all the time.
* I wanted to demo to some people why it's better to write javascript that avoids going back and forth to the DOM all the time.