Czy istnieje odpowiednik javascript do jQuery $('body')
, jak w poniższym kodzie? Chcę go uruchomić bez potrzeby 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');
}
Dzięki
https://gist.github.com/hughrawlinson/6078055
myślę 'document.body'? – Praveen