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>
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.
Semantically what you are trying is invalid html, table
element cannot have a div
element as a direct child. What you can do is, get your div
element inside a td
element and than try to hide it
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With