Javascript equivalent to $('body')

html, javascript, jquery

Solution

Yes, it is `document.body`

 var contents = document.body.innerHTML;

Problem

Is there a javascript equivalent to the jQuery `$('body')`, as in the following code? I want to get it running without requiring jQuery. ``` var content = $('body').html(); var comments = content.match(/<!--.*?-->/g); if(comments!=null|comments!=undefined){ for (var x = 0; x < comments.length;x++){ console.log(comments[x]); } } else{ console.log('No Comments'); } ``` Thanks https://gist.github.com/hughrawlinson/6078055

Original source