title: Uncaught ReferenceError: checkin is not defined at HTMLButtonElement.onclick
body: <p>I am facing a problem with js function on button click.</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;button class="checkin_button btn-block" onclick="checkin(345)"&gt;&lt;i class="fa fa-map-marker"&gt;&lt;/i&gt; Check In&lt;/button&gt;
  </code></pre>
  
  <p>My jQuery function is:</p>
  
  <pre class="lang-js prettyprint-override"><code>var CheckIn;
  $(document).ready(function() {
    CheckIn = function checkin(id) {
      jQuery.ajax({
        type: 'POST',
        url: ajaxurl,
        data: {
          action: 'foody_checkin',
          'restaurant' = id,
        },
        beforeSend: function() {},
        success: function() {}
      });
    }
  });
  </code></pre>
  
  <p>But its not working.</p>