jquery call function on click
<p>I am facing a problem calling a function on click. The following is my code:</p>

<p><strong>JavaScript:</strong></p>

<pre><code>$(document).ready(function(){       
    function showMessage(msg) {
        alert(msg);
    };      
})
</code></pre>

<p><strong>HTML:</strong></p>

<pre><code>&lt;input type="button" value="ahaha"  onclick="$(this).showMessage('msg');" /&gt;
</code></pre>

<p>for some reasons I cant use <code>click()</code> function. Please  help me.</p>
