I'm trying to find a way to put multiple text values that i extract from elements that has the same CSS and put them into a array in javascript. but i keep failing. i googled about it but couldn't find an answer for my problem.
anyone can tell what i did wrong and point out please?
here is the HTML part.
<div>
James
<div>English : <span class="jtest">80</span> </div>
<div>Japanese : <span class="jtest">60</span> </div>
<div>Science : <span class="jtest">78</span> </div>
<div>Art : <span class="jtest">85</span> </div>
<div>Philosophy : <span class="jtest">45</span> </div>
<div>Physical tranning : <span class="jtest">65</span> </div>
</div>
<br><Br>
<div>
Von
<div>English : <span class="vtest">80</span> </div>
<div>Japanese : <span class="vtest">85</span> </div>
<div>Science : <span class="vtest">67</span> </div>
<div>Art : <span class="vtest">64</span> </div>
<div>Philosophy : <span class="vtest">97</span> </div>
<div>Physical tranning : <span class="vtest">25</span> </div>
</div>
<br><Br>
<div>
Crack
<div>English : <span class="ctest">80</span> </div>
<div>Japanese : <span class="ctest">88</span> </div>
<div>Science : <span class="ctest">40</span> </div>
<div>Art : <span class="ctest">70</span> </div>
<div>Philosophy : <span class="ctest">80</span> </div>
<div>Physical tranning : <span class="ctest">69</span> </div>
</div>
and here is javascript part.
<script>
var james = [''];
james.push(document.getElementsByClassName("jtest"));
var Von = document.getElementsByClassName("vtest");
var Crack = document.getElementsByClassName("ctest");
console.log(james);
</script>
i want to put textContents of elements that has jtest class and put those values into a james variable like james ['80' , '60', '78', '85', '45', '65'];