title: How to count no. of image files in local folder using javascript
body: <p>I am new to JavaScript and am trying simple web design. I have a doubt that how to get no.of image files stored in local image folder using js code.</p>
  
  <p>I would like to get the no. of image files dynamically so that even if we are adding more images in folder any time that also will be displayed on web page.</p>
  
  <pre><code>function parenting {
    var n=3;
    for(var i=1; i&lt;=n; i++) {
      var img1 = document.createElement('img');
      img1.src = 'images/parenting/'+i+'.jpg';
      document.body.appendChild(img1);
    }
  }
  </code></pre>
  
  <p>In above code, i have given n=3 as default no. of image files but it should be taken from image folder by code.</p>