Display an alert box when ticking checkbox in Jquery
<p>How to display an alert box when ticking checkbox in Jquery? The alert box will disappear when checkbox is unticked.</p>

<p>I have tried the code below,but it doesn't work. Can anyone help me out? Thanks!</p>

<pre><code>&lt;script type="text/javascript"&gt;
        $(document).ready(function(){

            if($('#chkAll').is(':checked'))
           {
              alert("im checked");

           }

        });
        &lt;/script&gt;
&lt;input id="chkAll" /&gt;
</code></pre>
