function showValue() {
var columCount = document.getElementById("pio").rows.length;行数
var rowCount = document.getElementById("pio").rows.item(0).cells.length;///列数
alert(columCount);
alert(rowCount);
var my_array = new Array();
for (var i = 0; i < columCount; i++) {
my_array[i] = new Array();
for (var j = 0; j < rowCount; j++) {
my_array[i][j] = document.getElementById("pio").rows.item(i).cells.item(j).innerText;
}
}
for (var i = 0; i < columCount; i++) {
for (var j = 0; j < rowCount; j++) {
alert(my_array[i][j]);
}
}
}
alert(showValue());//测试
function getab() {
var ot = document.getElementById("pio");
var a = new Array();
var id = new Array();
var href= new Array();
var Array();
for (i = 0; i < pio.rows.length-1; i++){
a[i] = pio.rows[i+1].cells.item(1).innerHTML;//第一行是标题,不取值。
var regex_id=new RegExp("id=\"(\\S+[_]\\d+)\"","gi");
id[i] = a[i].match(regex_id);
var hrefstartindex = a[i].indexOf("href=\"")+6;
var hrefendindex =a[i].indexOf(";\"");
href[i]=a[i].substring(hrefstartindex,hrefendindex);
var = a[i].indexOf("οnclick=\"")+9;
var =a[i].lastIndexOf(";\"");
onclick[i]=a[i].substring(onclickstartindex,onclickendindex);
}
for (i = 0; i < pio.rows.length-1; i++){
alert(a[i]);
alert(id[i]);
alert(href[i]);
alert(onclick[i]);
}
}
alert(getab());//测试