---
title: "html js 静态页面模拟查询"
author: "spp_1987"
date: "2015-07-14T11:12:11Z"
tags: []
categories: ["Web前端"]
slug: "html-js"
draft: false
lastmod: "2015-07-14T11:12:11Z"
id: 2227133
url: "https://spp-1987.iteye.com/blog/2227133"
---

```
function selectQuery(){
      var flag = $("#flag").val();
      $("table[id='queryTb'] tr").find("td:eq(11)").each(function(i){
	  if(flag==this.innerHTML){
	      $(this).parent().show();
	  }else if(flag!="theEntp"){
	      $(this).parent().hide();
	  }else{
	      $(this).parent().show();
	  }
	})	
}
table列表 id = queryTb, 循环tr 找到 td 索引 遍历tr，相同的内容，就显示，不同内容就隐藏。
```