here is my code. http://pastemonkey.org/paste/229
for some reason i still cant get this to work. instead of using the toggle(); function i am manually toggling the elements based on the resulting string. but how can i select an element based on a variable. essentially the variable newSpecial is equal to the selector im trying to select. $(newSpecial) doesn't work, $("newSpecial") doesn't work. i cant figure it out. On Nov 29, 9:38 pm, Josh V <[EMAIL PROTECTED]> wrote: > wow silly me, after all I am trying to target the ID, # would be > useful. :p ill give that a try tomorrow. > > On Nov 29, 7:22 pm, Karl Swedberg <[EMAIL PROTECTED]> wrote: > > > On Nov 29, 2007, at 6:04 PM, Josh V wrote: > > > > on click i am storing the ID of an the <a> i clicked. > > > > i am then replacing characters in that string to get the desired > > > resulting string. > > > > i am then trying to toggle a div whos ID is the resulting string. > > > > heres what i got. > > > > $("ul#specialsNav li a").click( function(){ > > > var whichID = $(this).attr("id").replace(/_a_/, ""); > > > var newSpecial = "div." + whichID; > > > $(newSpecial).toggle(); > > > }); > > > > i have tried putting... > > > > $("newSpecial").toggle(); > > > > but nothing > > > Hi Josh, > > > Is it because you're using "div." instead of "div#"? You shouldn't > > even need the "div" part at all. Try this instead: > > > var newSpecial = "#" + whichID; > > > Hope that helps. > > > --Karl > > _________________ > > Karl Swedbergwww.englishrules.comwww.learningjquery.com