i'm trying to get content of div named 'topage' , i did this code
<script type="text/javascript">
var topagge = document.getElementsByClassName("topage");
console.log(topagge);
</script>
in the console it shows like this :
HTMLCollection[1] 0: span.topage ... innerText:"mycontentofdiv" length: 1 proto: HTMLCollection
i want to get the innerText value , i try this code :
console.log(topagge.innerText);
but in the console it's undefined
please how can i get content of this collection html object ( using the attribut 0 : span.topage wich contain the innerText.