Avatar of havj123
havj123
Flag 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
Web ApplicationsMicrosoft DevelopmentWeb Languages and Standards

Avatar of undefined
Last Comment
eguney

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
qwerty021600

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
havj123

ASKER
Thanks,
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

I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck