I am fairly new to jquery and still trying to get my head around some proper implementation. I'm hoping someone can explain why this works:
function doToggle(id){ id = '#'+id; $(id).toggle(); } but, this does not: function doToggle(id){ id = '#'+id; $(id).toggle( function(){alert('something');}, function(){alert('something else')} ); } This gets called from: <a href="javascript: void(0);" onclick="javascript: doToggle('some_div_to_toggle');">link</a> Any advice is appreciated.