changed to use GHCJS-DOM