write is actually defined on HTMLDocument, and overrides the definition you place on Document.