I have multiple hidden fields of the form
<input type="hidden" class="mail-contacts" name="to[]" value="abc1">
<input type="hidden" class="mail-contacts" name="to[]" value="abc2">
<input type="hidden" class="mail-contacts" name="to[]" value="abc3">

Number of hidden fields can be different for different cases. How can i get the values of these hidden fields ? As this is an array so can't get it with
document.getElementById('')
I need to get the values of these hidden fields and then pass it as query parameter. Please help me out how can i do this. Thanks.