0

I added elements in html page using JS, then I use query Selector All("element . class name") to access this element but it return zero. However the elements displayed in my web page.

var listItems=document.querySelectorAll(".list-items");
var x=listItems[0].querySelectorAll("img.list-item-img").length;
console.log(x);
<div class="list-items" id="mostReleaseList">
                    <!-- her will be tags by JS -->
</div>

0 Answers0