Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

<div style display="none" > inside a table not working

Tags:

html

dom

css

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.

like image 718
Contemplating Avatar asked Jul 04 '13 03:07

Contemplating


1 Answers

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

like image 135
Mr. Alien Avatar answered Oct 17 '22 11:10

Mr. Alien