I'm using the sandbox you hosted here: http://qiezi.me/projects/mruby-web-irb/mruby.html#
Calling Document does not work. Is something like this even possible?
Okay, I made a few changes, now the demo above should be able to access DOM(you may need to refresh the browser cache). For example, you can use following line to print the page title:
Here MrubyJs::get_root_object is actual window, and you can access any DOM object starting from this. For a more detailed explanation please refer to here.