Forum Moderators: open

Message Too Old, No Replies

"open/close box" script does nothing

maybe it's the style.visibility?

         

Br3nn4n

9:39 am on Feb 5, 2008 (gmt 0)

10+ Year Member



Snippet that's not working:

function openclosecommentbox() {
var openstatus = document.getElementById('commentbox').style.visibility;
if (openstatus == 'hidden') {
document.getElementById('commentbox').style.visibility = 'visible';
} else if (openstatus == 'visible') {
document.getElementById('commentbox').style.visibility = 'hidden';
}}

And below I have the link and div:

<p><a href="javascript:openclosecommentbox();">click to open / close comment box</a></p>

<div id="commentbox" style="visibility:hidden;">form here, blah blah...</div>

It just does nothing when I click it...ideas please? Thanks!

Br3nn4n

11:18 am on Feb 5, 2008 (gmt 0)

10+ Year Member



EDIT: It was working >< The text in my div was showing up white so I couldn't see the box lol

eelixduppy

10:40 pm on Feb 5, 2008 (gmt 0)



Glad you found your solution :)