This is nice and works but why not use https://github.com/code-dot-org/blockly/blob/master/src/dom.js#L1?