I know the title isn't the best, I didn't know how to put this in one sentence. Anyway, I've got some php code creating pairs of links and corresponding boxes which should toggle, when I hit the link. Now I was wondering how you do this in jQuery "the right way".
Until now I gave every link the class togglelink and an ID togglelink1, togglelink2 etc. The boxes then have the ID togglebox1... So I respond to $(".togglelink").click(), get the current ID, parse the number, add it to the box-ID and toggle the object.
This doensn't seem very straight foward as it's a task I'm sure is pretty common. Any suggestions on how I could improve this?