title: Get form values through JavaScript
body: <p>This is my HJTML code. I don't know how to get values stored in <code>filtertime[]</code> using JavaScript and make them show on my screen.</p>
  
  <pre><code>   &lt;form action="index.php" method="post" &gt;
  
      &lt;div class="col-lg-6"&gt;&lt;div class="f-txt-l"&gt;&lt;input id="test" type="checkbox" name="filtertime[]" class="morning" value="Morning"&gt;&lt;/div&gt; &lt;div class="f-txt-r"&gt;Morning&lt;/div&gt;&lt;/div&gt;
       &lt;div class="col-lg-6"&gt;&lt;div class="f-txt-l"&gt;&lt;input  id="test" type="checkbox" name="filtertime[]" class="morning" value="Afternoon"&gt;&lt;/div&gt; &lt;div class="f-txt-r"&gt;Afternoon&lt;/div&gt;&lt;/div&gt;
       &lt;div class="col-lg-6"&gt;&lt;div class="f-txt-l"&gt;&lt;input  id="test" type="checkbox" name="filtertime[]" class="morning" value="Evening"&gt;&lt;/div&gt; &lt;div class="f-txt-r"&gt;Evening&lt;/div&gt;&lt;/div&gt;
       &lt;div class="col-lg-6"&gt;&lt;div class="f-txt-l"&gt;&lt;input  id="test" type="checkbox" name="filtertime[]" class="morning" value="Night"&gt;&lt;/div&gt; &lt;div class="f-txt-r"&gt;Night&lt;/div&gt;&lt;/div&gt;
  
       &lt;div class="col-lg-12"&gt;&lt;input type="submit" name="button" class="apply-filter" value="Apply Filter"&gt;&lt;/div&gt;
  
  
          &lt;/form&gt;
  
  
     &lt;script&gt;
     var new =  document.getElementsById("test").innerhtml
     &lt;/script&gt;
  </code></pre>
  
  <p>How can I get input values in JavaScript through value is stored in array as <code>filtertime[]</code>?</p>