I am trying out javascript for the first time and would like to know how to get elements from inside elements so that I could display them to the user. I was wondering if there is any javascript code that could go and fetch the following items:
<ul id="tests">
<li class="test w0">
<div class="letter l0">a</div>
<div class="letter l1">b</div>
<div class="letter l2">c</div>
</li>
<li class="test w1">
<div class="letter l0">a2</div>
<div class="letter l1">b2</div>
<div class="letter l2">c2</div>
</li>
<li class="test w3">
<div class="letter l0">a3</div>
<div class="letter l1">b3</div>
<div class="letter l2">c3</div>
</li>
</ul>
I would like to get the letters inside of each list item that is inside of the "test" element. How would I do so using solely javascript?
All I want is to put the strings into an array to display to the user. I know how to display the info to the user, just not how to get the strings inside of the elements.
OUTPUT CODE:
[a,b,c,a2,b2,c2,a3,b3,c3] //Store strings in array
I don't understand JQuery, so please I would just like a javascript method....