Use closure here, add `HTMLDocument` event namespace.