Thank you for reply
the differnt with your code is using "editdoc.body.innerHTML="";" to clear the content
it works on chrom
However error occure on FireFox now:
InvalidNodeTypeError: The supplied node is incorrect or has an incorrect ancestor for this operation.
and still have error on IE:
Object doesn't support property or method 'addEventListener'
P.S.
I am using StandardDialog