could not get visibility property

hi, I have set of divs:  
<div id=$i'  style='visibility:collapse' ></div> and:

function show_comment(param) {
      if(window.prev_tag)  prev_tag.innerHTML = ' ';

      document.getElementById(paramt).innerHTML = 'some_txt';      
      window.prev_tag = document.getElementById(param);
}

the problem: when  I click another link  the previous div became empty as expected BUT doest collapse.

is there a way to force the div to return to its initial style'  ie :  <div id=$i'  style='visibility:collapse' ></div>



uk1900Asked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
HonorGodConnect With a Mentor Commented:
the visibility tells the browser to keep the item space there.  If you want to have div collapsed, you need to use:

  style="display:none"
0
 
jay_gadhaviCommented:
u can use : this.style.visibility='hidden' for hiding the div or this.style.visibility=' ' for visible the div.

Like example

<a style="color:black;" href="javascript:void(0);"
onclick="this.style.visibility='hidden';">
Click on me, monkey.
</a>

I think it may solved your proble,
Regards,
jay


0
 
uk1900Author Commented:
thx jay_gadhavi

yes it hides the div but doesnt collapse.

if u click now u still have an empty line between AAAA and BBBB.
-----------------
AAAA
<div style="color:black;" href="javascript:void(0);"
onclick="this.style.visibility='hidden';">
Click on me, monkey.
</div>
BBBBB
-----------------------
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
HonorGodCommented:
0
 
uk1900Author Commented:
thx HonorGod  it works.
0
 
HonorGodCommented:
Great.  Thanks for the 'A'.  Good luck
0
All Courses

From novice to tech pro — start learning today.