noob : how to toggle visibility of a target div from <a h
Hi
I have just started trying to use jquery and though it looks cool and simple I'm having really problems working out how to do a really simple thing
All the examples I've seen use css selectors to target an element in the page but i need to use an id.
basically I have a list of <a href> links and a load of <div>s that are all display:none by default when the page loads. The <a href> links and <div> elements are written dynamically by a php loop. What I would like to do is click on an <a href> link and make a specific <div> visible using its id. Sounds simple doesn't it ? But I can't figure out how to do this with jquery syntax.
In traditional js syntax I would write a function that would receive the id of the target div as an argument when the <a> tag is clicked. Then I would loop through all the divs and make them all display:none and then display the target div.
would i still need to put an onclick event in the <a href> links ?
or is there a way of getting the id of the <a href> and using that to target the correct <div> ?
I'm completely lost here and would appreciate some help getting my foot in the stirrup !!
thanks