title: Display id demo using name doesn't work when I use getElementsbyName
body: <p>I want to display the <strong>ID</strong> <code>demo</code> using <code>name</code> but it doesn't work when I use <code>getElementsbyName</code>.</p>
  
  <pre><code>&lt;input type="" id="demo" value="" class="form-control TimeInfo" name="txtTimeInfo[]" readonly /&gt;
  
  &lt;script&gt;
  var d = new Date();
  document.getElementById("demo").value= d;
  &lt;/script&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>