How can I stop custom jQuery function which is running?
<p>I have a custom jQuery function. When it runs every 5 seconds.</p>

<pre><code>(function($) {
        $.fn.mycustomfunction = function() {
            interval = setInterval(function() {
                console.log("I am running every 5 seconds");
            }, 5000);
        }
        return this;
    };
})(jQuery);

$("#container").mycustomfunction();
</code></pre>

<p>I have a </p>

<pre><code>clearInterval(interval);
</code></pre>

<p>to stop, but I also want to stop the function completely. How can I do that ?</p>