The jQuery function doesn't return DOM nodes. It returns an object that contains a collection of DOM nodes.

var el = $('#container');

creates a new instance of an object which happens to contain a reference to the DOM node with an ID of container. Every time the function gets called, you get a brand new instance of el, which means your toggle can never toggle.

To fix this, you're going to want to store the toggle data on the DOM node.