设置前台HTML文字不可见

yuxi5622 2011-01-26 06:14:40
在前台有这么一个东西,即一个checkbox,旁边是“评价”两个字。
<td>
<input type="checkbox" id="aa"/>评价
</td>
现在,我想要再后台的某个事件中,将checkbox与“评价”这两个字都隐藏了。checkbox可以解决,即
this.aa.Visible=false;
但是“评价”二字该如何隐藏呢?

...全文
225 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
yuxi5622 2011-01-26
  • 打赏
  • 举报
回复
[Quote=引用 2 楼 gsh945 的回复:]
如果是服务器代码,就在“评价”二字放到一个Literal中
如果是js代码,给td一个id,直接隐藏td,<td id='ttt'>
document.getElementById('ttt').style.display='none';
[/Quote]
还是您的答案比较机灵耶,我试试。
KK3K2005 2011-01-26
  • 打赏
  • 举报
回复
关系理顺

既然 checkbox和 评价 是一伙的
那么就放在一个容器里 然后控制容器的显示隐藏
<div id='aa' >
<input type="checkbox" />评价
</div>
yhtapmys 2011-01-26
  • 打赏
  • 举报
回复
<td>
<input type="checkbox" id="aa"/><div id="txtpj">评价</div>
</td>


document.getElementById("txtpj").style.display="none";
郭大侠_ 2011-01-26
  • 打赏
  • 举报
回复
如果是服务器代码,就在“评价”二字放到一个Literal中
如果是js代码,给td一个id,直接隐藏td,<td id='ttt'>
document.getElementById('ttt').style.display='none';
yixianggao 2011-01-26
  • 打赏
  • 举报
回复
L@_@K
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>InsertDocumentTitle</title>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<meta name="generator" content="editplus" />
<meta name="author" content="yixianggao@126.com" />
<meta name="keywords" content="" />
<meta name="description" content="" />
</head>

<body>
<table>
<tr>
<td>
<input type="checkbox" id="aa"/>评价
</td>
<td>12</td>
</tr>
<tr>
<td>21</td>
<td>22</td>
</tr>
</table>
</body>
<script type="text/javascript">
<!--
//this.aa.parentNode.style.visibility = "hidden";
// Or
this.aa.parentNode.innerHTML = "";
//-->
</script>
</html>

87,910

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧