Small Javascript DOM level 1 implementation