if (id.style.display == 'none')
else if (id.style.display == 'block')
A1ien51
11-24-2005, 03:54 AM
quick look:
= assigns a value
== compares a value
Eric
redux
11-24-2005, 04:03 AM
Yeah, but that's still not the error I'm getting. I wrote the example in about 10 seconds to show it, the only important part is the getElementByID bit.
I could even simplify the code to:
<script>
function get_id(id) {
var id = document.getElementByID(id);
}
</script>
and it'd still throw an error. Thanks for the correction, though.
getElementByID != getElementById:
var id = document.getElementById(id);
and for an easy function call:
function $() { return document.getElementById(arguments[0]); }
var obj = $('my_id');
redux
11-24-2005, 04:10 AM
Wow. I'm amazed...that's the fastest solution I've ever seen. Thank you. I thought javascript wasn't case sensitive, but, whatever.