Web Development



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";
} else {
obj.style.visibility = "hidden";

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.

Thread display: Collapse - | Expand +

All Answers

Share your knowledge

Related Discussions

Related Forums