[jQuery] quick question, selecting dynamic elements
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