Esiste un javascript equivalente a jQuery $('body')
, come nel seguente codice? Voglio farlo funzionare senza richiedere 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');
}
Grazie
https://gist.github.com/hughrawlinson/6078055
Penso 'document.body'? – Praveen