Registering a Named Function as a Listener with Jquery
Posted
by Marcus
on Stack Overflow
See other posts from Stack Overflow
or by Marcus
Published on 2010-03-27T23:13:28Z
Indexed on
2010/03/27
23:23 UTC
Read the original article
Hit count: 345
I'm new to javascript/jquery and I've done some poking around the web, but I can't figure out why the following is invalid:
var toggleSection = function(sectionName) {
// Do some Jquery work to toggle stuff based on sectionName string
// (concatenate sectionName with other text to form selectors)
};
$('#togglecont1').click(toggleSection("container1"));
Is there something obvious I'm missing? Thanks in advance.
© Stack Overflow or respective owner