< div样式显示=“无”; >表内不工作 [英] <div style display="none" > inside a table not working
本文介绍了< div样式显示=“无”; >表内不工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试使用javascript切换具有标签和文本框的div元素的显示。
这是代码段
I am trying to toggle display of a div element which has a label and a textbox using javascript. Here is the code snippet
<table id="authenticationSetting" style="display: none">
<div id="authenticationOuterIdentityBlock" style="display: none;">
<tr>
<td class="orionSummaryHeader"><orion:message key="policy.wifi.enterprise.authentication.outeridentitity"/>: </td>
<td class="orionSummaryColumn">
<orion:textbox id="authenticationOuterIdentity" size="30"/>
</td>
</tr>
</div>
</table>
但是在页面加载时div元素仍然显示,切换表元素的显示效果很好。
我不知道为什么它不起作用,可能是table元素的样式覆盖了div元素的样式。
P.S.我仍然能够隐藏div中的元素,但不能隐藏div本身。
However on page load the div element still displays ,the display toggling for the table element is working fine. I am at a loss as to why this is not working,could it be that the style of the table element is overriding the style of the div element. P.S. I am still able to hide elements inside the div but not the div itself.
推荐答案
只需更改< ; div>
到< tbody>
<table id="authenticationSetting" style="display: none">
<tbody id="authenticationOuterIdentityBlock" style="display: none;">
<tr>
<td class="orionSummaryHeader">
<orion:message key="policy.wifi.enterprise.authentication.outeridentitity" />:</td>
<td class="orionSummaryColumn">
<orion:textbox id="authenticationOuterIdentity" size="30" />
</td>
</tr>
</tbody>
</table>
这篇关于< div样式显示=“无”; >表内不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文