replace var $doc on $(document)