I think you are trying to do something like this:
Example:

<div id="holder_of_links">
    <a href="some_url" onclick="highlight(this,'holder_of_links');
return false;" class="link_class">Link1</a>
    <a href="some_url" onclick="highlight(this,'holder_of_links');
return false;"  class="link_class highlighted">Current link with to
classes (highlighted)</a>
    <a href="some_url" onclick="highlight(this,'holder_of_links');
return false;"  class="link_class">Link3</a>
</div>

function highlight(link, holder_id){
    // remove any links with "highlighted"
    $
(holder_id).getElementsyClassName('highlighted').each(function(a_link)
{ a_link.removeClassName('highlight'); });
    // add highlight class to the active link
    $(link).addClassName('highlighted');

}



On Nov 24, 7:05 am, PAOEGONVG <[EMAIL PROTECTED]> wrote:
> Hi, I'm using prototype on a site I'm working on. And I'm trying to
> figure out how to make it so when someone clicks a link, it makes that
> on the highlighted tab. Like it removes a specific class from another
> co   ntainer, and sets it to the clicked on instead?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to