Hi there, I have read another post/question regarding jquery variables and it was useful but I'm still having trouble understanding... Below is a bit of code from a simple tabbed content functionality that I'm modifying.
Please could someone explain why this works:
$tabMenuItem.click(function() {
var activetab = $(this).find('a').attr('href');
$(activetab).show(); //show the active ID content
return false;
});
..and why this throws a '$activetab.show is not a function' error:
$tabMenuItem.click(function() {
var $activetab = $(this).find('a').attr('href');
$activetab.show(); //show the active ID content
return false;
});
From what I can gather, both ways show the variable to hold the correct value - only the second version won't let me attach a jquery method/function to it...?
I'm not a strong programmer, and any clarification would be appreciated!