Html/Javascript Checkboxes with same class and ID
===

My form, say, has multiple checkboxes. Some of these, are named the same, I.E

    <input type="checkbox" name="check[4]" /> 
    <input type="checkbox" name="check[2]" /> 
    <input type="checkbox" name="check[4]" /> 
    <input type="checkbox" name="check[5]" /> 

So If I uncheck/check

    <input type="checkbox" name="check[4]" />

how do I do so such that both of them will be checked/unchecked?

Thank you!