jQuery hide/show div using variables
Posted
by user295927
on Stack Overflow
See other posts from Stack Overflow
or by user295927
Published on 2010-03-17T18:19:26Z
Indexed on
2010/03/17
18:21 UTC
Read the original article
Hit count: 197
jQuery
I am a nOOb to jQuery.
I want to use variables in jQuery to hide/show divs.
what I have so far is:
$(document).ready(function(){ $('#listMenu a').click(function () { var getPage = $(this).attr("id"); var getName = $(this).attr("name"); //console.log(getPage); //console.log(getName);
$("#" & getName ).show();
});
});
firebug console shows that I have the vars correctly, but I get this error next:
this[H].style is undefined [Break on this error] (function(){var R=/((?:((?:([^()]+)...typeof K==="string"?K:K+"px")}})})();
any help is appreciated. sjs
© Stack Overflow or respective owner