Fix jQuery.parseHTML does not recognize document

Fix #2307.