0

I am trying to hide the dive using style property of div i.e.

    <div id="<%=divCount%>" style="display: block" hidden>

But it is not working.
And I am also writing a script in the head for hiding/showing divs. It is also not working

<script type="text/javascript"> function showAccount(divId){    document.getElementById(divId.value).style.display = "none";    echo divId.value; }

How Do I fix it? `

Jarvis0809
  • 11
  • 1
  • 5

1 Answers1

3

From this link: How do you create a hidden div that doesn't create a line break or horizontal space? It looks like the hidden tag, it should be <div id="<%=divCount%>" style="display: block visibility: hidden">

For JavaScript, you shouldn't be changing the display element, but from here: http://www.w3schools.com/cssref/pr_class_visibility.asp

You should be doing document.getElementById(divId.value).style.visibility = "hidden";

Community
  • 1
  • 1
sahilkmr78
  • 164
  • 9