JQuery "onclick" event plus "onload"
<p>Sometimes I encount following problem:
I am using asp.net and JQuery on client side. For example I want to show/hide texbox depending on state of checkbox. I write something like this:</p>

<pre><code>   $(function() {         

       $('#&lt;%=chbMyCheckbox.ClientID %&gt;').click(function(event) {

           if (this.checked) {
             $('#txFirstAid').show();
           } else {
             $('#txFirstAid').hide();
           }
       });
   });
</code></pre>

<p>It works fine. But I also want to run this code when page is just loaded. Sure, I can move code to separate function like this:</p>

<pre><code>   $(function() {         
         myFunc();
       $('#&lt;%=chbMyCheckbox.ClientID %&gt;').click(function(event) {
           myFunc();

       });

          function myFunc()
          {
           if (this.checked) {
             $('#txFirstAid').show();
           } else {
             $('#txFirstAid').hide();
           }
          }
   });
</code></pre>

<p>The question is: Is it possible somehow not to move code otside, and write something like this</p>

<pre><code>$('#&lt;%=chbMyCheckbox.ClientID %&gt;').click(function(event).onloadEvent()
{
    bla-bla
}
</code></pre>
