js里没有两维数组,但Array对象是个Object,里面可以放任何东西,
js里的两维数组是,Array套Array

你可以选择用两个数组来做

<HTML>
<HEAD>
</HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!--
function fun(){
var arr1 = new Array();
var arr2 = new Array();
var boxObj = document.getElementsByName("chkBox");

var str = "";
var index = 0;
for(i=0;i<boxObj.length;i++){
if(boxObj[i].checked){
arr1[index] = i+1;
arr2[index++] = boxObj[i].value;
}
}

for(i=0;i<arr1.length;i++){
str += arr1[i] + " " + arr2[i] + "<br>";
}
document.getElementById("txt").innerHTML=str;

}
//-->
</SCRIPT>
<BODY>
<input type="button" name="btn" value="click" onclick="fun();"><br>
<input type="checkbox" name="chkBox" value="a"> 1 a<br>
<input type="checkbox" name="chkBox" value="b"> 1 b<br>
<input type="checkbox" name="chkBox" value="c"> 1 c<br>
<input type="checkbox" name="chkBox" value="d"> 1 d<br>
<input type="checkbox" name="chkBox" value="e"> 1 e<br>
<input type="checkbox" name="chkBox" value="f"> 1 f<br>
<div id="txt"></div>
</BODY>
</HTML>





   var familyMembers = document.getElementsByName("chkBox");

   for(var i=0; i<familyMemberArray.length; i++) {   
    for(var j=0; j<familyMembers.length;j++) {
     if(familyMemberArray[i] == familyMembers[j].value) {       
      familyMembers[j].checked = true;     
      break;
     }
    }
   }