解决方案 »
- jquery事件问题, 急急
- 大家帮我看看哪错了。settimeout问题,说是缺少对象
- !急:当一个页面窗口中使用javascript操作另外一个窗口的document元素的内容时,IE报Access is denied怎么解决?
- 有关parseFloat函数使用
- 请问怎样用正则把这些td之间的数据匹配出来
- 大家帮看看什么意思啊
- iframe 不能正常显示
- 郁闷!没人理我!干脆再发一贴!
- artdialog 弹出页面使用浏览器打印问题(请教能人志士帮帮忙)
- angular引入HttpClientMoudle却找不到路径?求大神指点一下
- 关于在线编辑器的问题,怎样获得选中文字并进行处理
- 打开页面大小控制
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312"/>
<script type="text/javascript">
var arraydata = [["1", "zhang", "422"],["2","huang","514"],["3","li","4141"]]
var data = new Array(3);
function onchangeselect() {
var objsel = document.getElementById("selectopt");
for (var i = 0; i < arraydata.length; i++) {
if (objsel.value == arraydata[i][0]) {
data[0] = arraydata[i][0];
data[1] = arraydata[i][1];
data[2] = arraydata[i][2];
break;
}
}
var objtab = document.getElementById("showtable");
var objch = objtab.childNodes;
for(var i= 0;i<objch.length;i++){
objtab.removeChild(objch[i]);
}
insertRow("名次","姓名","借阅量");
insertRow(data[0],data[1],data[2]);
}
function insertRow( a, b, c){
var objtab = document.getElementById("showtable");
var index = objtab.rows.length;
var nextRow = objtab.insertRow(index);
var newCellCartonNo1 = nextRow.insertCell(0);
var newCellCartonNo2 = nextRow.insertCell(1);
var newCellCartonNo3 = nextRow.insertCell(2);
newCellCartonNo1.innerText = a ;
newCellCartonNo2.innerText = b ;
newCellCartonNo3.innerText = c ;
} </script>
</head>
<body><div style="height:20px"></div>
<div style="margin:0px 0px 0px 20px">
<div style="float:left">2009年1月1日-2009年2月1日</div>
<div style="float:left;margin:-5px 0px 0px 60px">
<select id="selectopt" onchange="onchangeselect()">
<option>单位</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>
</div>
</div>
<div style="height:34px"></div>
<div id="JKDiv_1" style="margin-left:20px">
<table width="100%" border="0" cellspacing="0" cellpadding="0" id="showtable" >
<tbody>
<tr height="25" id="titletr">
<td>名次</td>
<td>姓名</td>
<td>借阅量</td>
</tr>
<tr height="25">
<td>1</td>
<td>李司</td>
<td>2000</td>
</tr>
<tr height="25">
<td>1</td>
<td>李司</td>
<td>2000</td>
</tr>
<tr height="25">
<td>1</td>
<td>李司</td>
<td>2000</td>
</tr>
<tr height="25">
<td>1</td>
<td>李司</td>
<td>2000</td>
</tr>
<tr height="25">
<td>1</td>
<td>李司</td>
<td>2000</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>
不知道是不是这样