Fixed a bug where createTextRange was called on the document instead of the body.