Link to home
Start Free TrialLog in
Avatar of havj123
havj123Flag for India

asked on

How to Hide DIV content

Hi,
I have a table with some html controls. I want to hide the table on some event. So take a <DIV> with visibility:hidden. But the problem is the TABLE also contain a <div> with visibility:visible. And it make the inner div visible.


What do i do?  The code is attached
<DIV> //Want to hide that DIV with TABLE
   <table>
       <DIV style="visibility:visible">
          //some controls
      </DIV>
  </table>
</DIV>

Open in new window

Code.txt
ASKER CERTIFIED SOLUTION
Avatar of qwerty021600
qwerty021600
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of havj123

ASKER

Thanks,
Avatar of eguney
eguney

first of all you should give id's to your divs. like the one I put on the code snippet. Then in your control you can call a javascript function that makes both divs display:none... for example
function f_hide()
{
document.getElementById('div2').style.display='none';
document.getElementById('div1').style.display='none';
}

<DIV id=div1> //Want to hide that DIV with TABLE
   <table>
       <DIV id=div2 style="visibility:visible">
          //some controls
      </DIV>
  </table>
</DIV>

Open in new window