title: call a function from javascript in jquery
body: <p>How do i call a function in jquery that i have written? The following code that I tried is not working.</p>
  
  <pre><code>&lt;script&gt;
      $(function(){
          function afunction() {
              alert("me");
          }
      });
  &lt;/script&gt;
  
  &lt;script&gt;
      afunction();
  &lt;/script&gt;
  </code></pre>