title: How to fix "TypeError: $ is not a function" error in WordPress custom page?
body: <p>I created custom WordPress page via plugin where I want to toggle on/off comments using this code</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;                 
    $("comment_switch").click(function () {
      $("comments").toggleClass("hidden");
    });
  &lt;/script&gt; 
  </code></pre>
  
  <p>I placed it inside the <code>&lt;body&gt;</code> tag. To generate <code>&lt;head&gt;</code> tag I used standard WordPress function <code>wp_head();</code>. When I check the source code of the page I can see in head section <code>&lt;script src="http://10.1.1.6/wp-includes/js/jquery/jquery.js?ver=1.10.2" type="text/javascript"&gt;</code> which I thought would be enough to use jQuery.</p>
  
  <p>Could someone help me to make the jQuery code work? The whole source code of the page could be found <a href="http://pastebin.com/DLB7wQ8V" rel="noreferrer">here</a></p>