Use children instead of childNodes when replacing using done(html) or return html inside a ready callback. Remove redundant function.