获取表格中的值

<html>
<head>
<script type = 'text/javascript'>
var curRow; //全局行号
var curRowId; //选中行的记录信息的ID
var curColor;
function selectRow(tr){//tr行本身
curRow = tr;
curRowId = tr.id;
alert(tr.cells[0].innerText);
}
</script>
</head>
<body onload = "javascript:selectRow(1)">
<table border = "1 solid">
<tr onclick = "selectRow(this);">
<td>001</td>
<td>google</td>
</tr>
<tr onclick = "selectRow(this)

猜你喜欢

转载自www.cnblogs.com/jtz-79879/p/9069742.html
今日推荐