Question

Locked

I need Javascript help with asp please ?!?

By brian ·
I have <div id="htldiv" style="display:none; visibility:hidden"> info info info </div> and want to change the display from none to block and visibility to show (or whatever it needs to be). This is being controled by a check box, on check show and activate, uncheck hide and deactivate (so it doesn't push my page down) I am using the following javascript in a aspx page to do this but it isn't working quite right:

function hoteldivstuff(id) {
var obj = document.getElementById(id);
if (obj.style.visibility=="hidden") {
obj.style.visibility = "visible";
document.getElementById("hoteldiv").style.display=="block";
} else {
obj.style.visibility = "hidden";
document.getElementById("hoteldiv").style.display=="none";
}
}

If i take the display out of the <div> this code will work, however when I put it in, it doesn't show the <div> any more...I am sure it has to deal with my document.getElementByID lines, but I'm not sure how to fix it up right. I googled a little, but I am completely dumb when it comes to JavaScript!!!!!!!!!! HELP!! (Please :-) )

This conversation is currently closed to new comments.

0 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Answers

Share your knowledge
Back to Web Development Forum
0 total posts (Page 1 of 1)  

Related Discussions

Related Forums