Could someone explain how I change the CSS class name itself as opposed to the style attributes?
I would add an onclick() method to both the <a>’s of both <div>s. Will this even change the styles when the user clicks (the styles are in a .css file)?
I’m just not sure of the syntax on the actual swap. What’s syntax of accessing the parent <div> of the <a>? And what’s the DOM method for finding the “selected” <div>?
Thanks a lot!
/mod - moved to off-topic ... Chris..S
Read up on the DOM.
The property you are looking to change is className. And given when you change an attribute from "notselected" to "selected" you are probably going to want to find the previously selected element and change it to notselected you need a little complexity.
The easiest way to do this would be using and ID for "selected" rather than a class.