[javascript]代码库
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>RunJS 演示代码</title>
<script>
var chazhao = function (){
var trs = tab1.tBodies[0].rows;
for(var i = 0; i < trs.length; i++){
var tr = trs[i];
if(tr.innerHTML.search(oTXT.value) == -1)
tr.style.display = 'none';
else
tr.style.display = '';
}
}
</script>
</head>
<body>
<form>
<span>输入查询的关键字:</span>
<input type="text" id="oTXT" />
<input type="button" value="查找" onclick="chazhao()" />
</form>
<table border="1px" id="tab1" width="500">
<thead>
<tr>
<td>姓名</td>
<td>职位</td>
<td>手机</td>
<td>分机</td>
</tr>
</thead>
<tbody>
<tr>
<td>111</td>
<td>222</td>
<td>333</td>
<td>444</td>
</tr>
<tr>
<td>589</td>
<td>666</td>
<td>777</td>
<td>888</td>
</tr>
<tr>
<td>567</td>
<td>888</td>
<td>999</td>
<td>999</td>
</tr>
</tbody>
</table>
</body>
</html>