[ACCEPTED]-Hide 'div' tag in JavaScript-dreamweaver

Accepted answer
Score: 11

Use:

document.getElementById("div").style.display = 'none';

0

Score: 7

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

Score: 2

Try this ..

 document.getelementById("div_id").style.display = 'none';

0

Score: 0
document.getElementById("yourdivID").style.display = 'none';

0

Score: 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

More Related questions