Using JavaScript to Check Multiple Checkboxes

I have a form, within it is a table with multiple checkboxes and text input boxes. The checkboxes do not have ids, only different attributes. I want to check off multiple boxes when I run the script in the console. I cannot edit the HTML. This is what I’ve got so far, but I’m not sure how to get it to work, or if it is even possible. Thanks for any help.

function chk () {
  document.querySelector('[name="A"]').checked = true; 
  }
<form>
<table>
    <TR>
         <TD align="left"><INPUT TYPE=CHECKBOX NAME="A">A:</TD>
         <TD align="right"><input type="text" name="effDateTxtA" value="" class="detailstyle"></TD>
    </TR>
 </table>
 </form>