title: How to call jQuery function when checkbox is checked by PHP?
body: <p>Here is my PHP code:</p>
  
  <pre><code>&lt;?php if (isset($mod['display']) &amp;&amp; ($mod['display'] == "1")) { ?&gt;
      &lt;input class="display_checkbox" type="checkbox" name="chk[&lt;?php echo $row; ?&gt;][display]" value="1" checked="checked" onclick="checkbox_click(this);" /&gt;
  &lt;?php } else { ?&gt;
      &lt;input class="display_checkbox" type="checkbox" name="chk[&lt;?php echo $row; ?&gt;][display]" value="1" onclick="checkbox_click(this);" /&gt;
  &lt;?php } ?&gt;
  </code></pre>
  
  <p>jQuery:</p>
  
  <pre><code>function checkbox_click(current) {
    if($(current).is(':checked')) {
            // do stuff....
    } else {
            // do stuff....
    }
  }
  </code></pre>
  
  <p>In the above code, when <code>$mod['display']</code> is true, the checkbox is checked but it does not invoke <code>checkbox_click()</code> function. I tried <code>onchange=</code> instead of <code>onclick=</code> but it does not seem to have any effect. I need to keep the <code>onclick</code> or <code>onchange</code> in the  field.</p>