Is there any way of me altering the following code to only check the checkbox with IDs that contain the letter 'A'
e.g. <input type=checkbox name=list value="1A">Java<br>

<html xmlns="" >
<head runat="server">
    <title>Untitled Page</title>
    <SCRIPT LANGUAGE="JavaScript">
var checkflag = "false";

function check(field) {
    if (checkflag == "false") {
        for (i = 0; i < field.length; i++) {
        field[i].checked = true;}
        checkflag = "true";
        return "Uncheck All"; }
    else {
        for (i = 0; i < field.length; i++) {
        field[i].checked = false; }
        checkflag = "false";
        return "Check All"; }

<form name=myform action="" method=post runat=server>
<b>Your Favorite Scripts & Languages</b><br>

<input type=checkbox name=list value="1">Java<br>
<input type=checkbox name=list value="2">JavaScript<br>
<input type=checkbox name=list value="3">ASP<br>
<input type=checkbox name=list value="4">HTML<br>
<input type=checkbox name=list value="5">SQL<br>
<input type=button value="Check All" onClick="this.value=check(this.form.list)">