show element if class matches current body id (Please help)
hi Im new to jquery and having some trouble adapting the code below. the function is for a accordion menu. I want it to recognize the body's id, and show the sub menu who's class matches the body id. right now it is set to show the submenu with class="test".
function initMenu() {
$('#menu ul').hide();
$('#menu ul.test').show();
$('#menu li a').click(
function() {
$(this).next().toggle();
}
);
}
$(document).ready(function() {initMenu();});
do i start with something allong the lines of
var bodyid = $("body").attr("id");
?
Any suggestions greatly appreciated.
Thanks
-Max