<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme() + "://"
+ request.getServerName() + ":" + request.getServerPort()
+ path + "/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>My JSP 'jquery.jsp' starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<script type="text/javascript" src="/common/easyui/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("tr:hidden").css("display","block");
});
</script>
</head>
<body>
<table>
<tr style="display:none"><td>Value 1</td></tr>
<tr><td>Value 2</td></tr>
</table>
</body>
</html>
30 <tr style="display:none"><td>Value 1</td></tr>
此行代码隐藏了tr
24 $("tr:hidden").css("display","block");
此行代码选中了所有tr为hidden的元素,指定显示方式为block
重点解释:
:hidden
匹配所有的不可见元素,input 元素的 type 属性为 "hidden" 的话也会被匹配到
$("tr:hidden")
查找type为hidden的tr元素
相似知识点:
:visible
匹配所有的可见元素
$("tr:visible")
查找type为visible的tr元素