[ACCEPTED]-Hide 'div' tag in JavaScript-dreamweaver
Accepted answer
Use:
document.getElementById("div").style.display = 'none';
0
You should use:
document.getElementById("div").style.display = "none";
Just to mention that getElementById()
will 5 be looking for a div
with the id of div
, I suggest 4 you change this to something more obvious, an 3 example would be:
<div id="container"><!--Content--></div>
Then your JavaScript could 2 be:
document.getElementById("container").style.display = "none";
Check here to see what the difference is 1 between display:none
and visibility:hidden
Try this ..
document.getelementById("div_id").style.display = 'none';
0
document.getElementById("yourdivID").style.display = 'none';
0
Use
document.getElementById("divID").style.display = "none";
OR
document.getElementsByTagName("div").style.display = "none";
NOTE: document.getElementById()
only select the elements having id
attributes.
0
Source:
stackoverflow.com
More Related questions
Cookie Warning
We use cookies to improve the performance of the site. By staying on our site, you agree to the terms of use of cookies.