I am trying to print the first ten entries of a website which has a list, and I want the result in the console itself. Here's the structure of the HTML it's using
<div class=classname>
<b>The text i want</b>
</div>
here's what i tried running in the console:
list = document.getElementsByClassName('classname')
for(var i=0;i<10;i++)
{
console.log (list[i])
}
I am at a loss of what to do next. I'm fairly new to javascript so any help would be greatly appreciated.
console.log (list[i].textContent)