jquery 隐藏与显示tr标签示例代码
<%@pagelanguage="java"import="java.util.*"pageEncoding="UTF-8"%>
<%
Stringpath=request.getContextPath();
StringbasePath=request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPEHTMLPUBLIC"-//W3C//DTDHTML4.01Transitional//EN">
<html>
<head>
<basehref="<%=basePath%>">
<title>MyJSP'index.jsp'startingpage</title>
<metahttp-equiv="pragma"content="no-cache">
<metahttp-equiv="cache-control"content="no-cache">
<metahttp-equiv="expires"content="0">
<metahttp-equiv="keywords"content="keyword1,keyword2,keyword3">
<metahttp-equiv="description"content="Thisismypage">
<!--
<linkrel="stylesheet"type="text/css"href="styles.css">
-->
<scripttype="text/javascript"src="js/jquery-1.8.2.js"></script>
<scripttype="text/javascript">
functionselectChange(obj){
varvalue=obj.value;
varv1=document.getElementById("tr1");
varv2=document.getElementById("tr2");
if(value==0){
console.log("twoishidden");
v1.style.display="none";
v2.style.display="none";
}elseif(value==1){
v1.style.display="block";
v2.style.display="none";
}else{
v1.style.display="none";
v2.style.display="block";
//将里面的值设为空
}
}
</script>
</head>
<center>
<body>
<formaction="GetJSPContent"method="post">
<table>
<tr>
<td>通知标题</td>
<td><inputtype="text"name="title"/></td>
</tr>
<tr>
<td>通知内容</td>
<td><textareacols="50"rows="10"name="cxt">内容这块暂时没处理,本次测试用例需要10个汉字以上测试</textarea></td>
</tr>
<tr>
<td>通知类型</td><td><selectonchange="selectChange(this)">
<optionvalue="0"select="true">所有用户</option>
<optionvalue="1">用户组</option>
<optionvalue="2">单用户</option>
</select></td>
</tr>
<trid="tr1"> 热门推荐
10 五一公司放假祝福语简短
11 追星女孩的祝福语简短
12 给长辈端午祝福语 简短
13 生日祝福语有诗意简短
14 团圆日祝福语简短
15 中秋商务祝福语简短最新
16 温暖文艺简短祝福语短句
17 男孩上学祝福语简短的
18 入住酒店文案祝福语简短