Let's say I want to handle all links on a page, via a special function, so I do:
$('a').bind("click", handleLinks);
But I have a navbar with links that I want to handle differently. So I want to do this, which does not work:
$('#navbar a').unbind("click", handleLinks);
I do not want to specifically exclude the navbar in the first statement, because content is loaded dynamically, so the elements I need to monitor for clicks will change depending on the content. Basically I want to be able to unbind specific subsets of elements dynamically, from the larger initial subset of elements that was bound initially.
Any suggestions?
:: UPDATE ::
My sincere apologies, you're all correct - there was something funky with the order the commands were being called. Sorry!