title: How To Get Child Elements Of tag 'li' In The 'ul' In javascript
body: <p>When getting the list elements in ul, we use get element by class name or tag and are returned in an array</p>
  
  <pre><code>var targetImages = document.getElementById("image-list-view").getElementsByTagName("img");
  </code></pre>
  
  <p>I need to get the element image in this list and i seem to be stack</p>
  
  <pre><code>&lt;ul id="image-list-view"&gt;
      &lt;li&gt;
          &lt;a href="#"  data-gallery&gt;
              &lt;img src="images/pic1.jpg"/&gt;
          &lt;/a&gt;
      &lt;/li&gt;
      &lt;li&gt;
          &lt;a href="#"  data-gallery&gt;
              &lt;img src="images/pic2.jpg"/&gt;
          &lt;/a&gt;
      &lt;/li&gt; 
  &lt;/ul&gt;
  </code></pre>
  
  <p><strong><em>EDIT</em></strong></p>
  
  <p>Sorry i didnt explain the problem with the code.
  <a href="https://i.stack.imgur.com/ctFYd.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ctFYd.png" alt="console chrome"></a></p>
  
  <p>the code works fine when the site starts but <code>targetImages</code> can no longer be accessed later or referenced ie (images cannot be accessed);</p>