The end game is to have a WebAssembly module that you can load just like you now load a JS script.
When we get there, there will also be (probably[1]) easy methods to access the DOM from WebAssembly.
At the moment the easiest way would probably be to write some glue code in JavaScript (see Let’s write Pong in WebAssembly https://medium.com/@mbebenita/lets-write-pong-in-webassembly...).
[1] https://github.com/WebAssembly/gc/blob/master/proposals/gc/O...