I'm building a website for an unnancounced project (doesn't mean I'm giving up on other projects, jsut something on the side), and I realise that my PHP/MySQL knowledge is almost useless for the site I want to program.
I need to learn to use Javascript to get a div element from my CSS block and change its visibility property. When doing this, it also has to change every other div's visibility to hidden. I got some of this code off a tutorial and I was wondering what I needed to do.
function showDiv(act1) {
myReference = getRefToDiv(act1);
if( !myReference ) {
window.alert('Nothing works in this browser');
return; //don't go any further
}
if( myReference.style ) {
myReference.style.visibility = 'visible';
} else {
myReference.visibility = 'show';
}
}
The div I want to change the visibility of is called "(#)act1", and it is all set up well and defaults to hidden visibility on page load. My link is <a href="#" onclick="showDiv('act1');">Link Text</a>.
However, this doesn't show the act1. I was wondering if anyone who actually knows Javascript and DHTML might have an idea of what to do.
Thanks.












