title: How to event.target a form's name which is an array?
body: <p>I have a few checkbox that have name let say checkBoxName[]. How do I read the value in it? I submit it to my handleSubmit function and failed to post it using Fetch.</p>
  
  <pre><code>  &lt;div&gt;
      &lt;input type='checkbox'  name='checkBoxName[]' value='1'/&gt;
      &lt;input type='checkbox'  name='checkBoxName[]' value='2'/&gt;
      &lt;input type='checkbox'  name='checkBoxName[]' value='3'/&gt;
    &lt;/div&gt;
  </code></pre>
  
  <p>In my submit function, I tried this and it didn't work and returned <code>Uncaught TypeError: Cannot read property 'value' of undefined</code>. I used the console.log to see what is being passed back.</p>
  
  <pre><code>  handleSubmit = event =&gt; {
      event.preventDefault();
      console.log(event.target.checkBoxName.value)
      //console.log(event.target.checkBoxName[].value)   //This gives me error, cannot use [] here
  
      // fetch(............, {
      //   method: "POST",
      //   headers: { "Content-Type": "application/json" },
      //   body: JSON.stringify({
      //     checkBox: event.target.checkBoxName.value
      //   })
      // })
      //   .then(response =&gt; {
      //     console.log(response);
      //     if (response.status === 200) {
      //       console.log('successfully')
      //     } else {
      //       alert('Check your inputs')
      //     }
      //   })
      //   .catch(error =&gt; {
      //     alert('Server error')
      //   });
    }
  </code></pre>
  
  <p>Can someone tell me how to read the value and to post it correctly? Thank you</p>
  
  <p>Edited:  I want to see how the array looks like that is going to be passed to the server.</p>