Show/hide multiple elements with one link using javascript

Giganews Newsgroups
Subject: Show/hide multiple elements with one link using javascript
Posted by:  itunes…@gmail.com (itunes…@gmail.com)
Date: 14 Oct 2005

how can i do this i already have a function to show/hide elements with
one link but how can i show/hide multiple elements

here is the script

function obj_ref(object)
{
    if (document.getElementById)
    {
        return document.getElementById(object);
    }
    else if (document.all)
    {
        return eval('document.all.' + object);
    }
    else
    {
        return false;
    }
}

function obj_toggle(object, open_close, open_text, close_text)
{
    var object = obj_ref(object);
    var icone = obj_ref(open_close);

    if( !object.style )
    {
        return false;
    }

    if( object.style.display == 'none' )
    {
        object.style.display = '';
        icone.innerHTML = close_text;
    }
    else
    {
        object.style.display = 'none';
        icone.innerHTML = open_text;
    }
}

Replies