I seem to have a problem accessing a childnode's childnode, without doing it in a very ineffective way.
Say I have this HTML:
<div class="parent">
<div class="child">
<div class="childIWantToGet">
</div>
</div>
</div>
I've tried this in JS:
parent.childNodes[0].childNodes[0]
.. And it's not very effective if I have to access a childnode, say 10 levels down.
I did try:
parent.closest(".childIWantToGet");
..But this return null.
Am I missing something very obvious here?
Sorry if this question have been asked before. I have been looking for quite a time for an answer now.
Thanks in advance.