Using "this" from event handler in jquery
<p>I have the following javascript code found also in this fiddle: <a href="http://jsfiddle.net/periklis/k4u4c/" rel="nofollow">http://jsfiddle.net/periklis/k4u4c/</a></p>

<pre><code>&lt;button id = "element_id" class = "myclass"&gt;Click me&lt;/button&gt;
&lt;script&gt;
    $(document).ready(function() {
        this.myfunc = function() {
            console.log('Hello world');
        }
        this.myfunc();
        $('#element_id').select('.myclass').bind('click', function() {
            this.myfunc(); //Obviously this doesn't work
        });
    });
&lt;/script&gt;​
</code></pre>

<p>How can I call this.myfunc() when the element is clicked? I don't want to define the myfunc() in the global space.</p>

<p>Thanks as always</p>
