title: How do I reassign a Javascript event using jQuery?
body: <p>When I log the click handler in js, (var clickHandler = button.onclick;) it gives the following as expected:</p>
  
  <pre><code>clickHandler:function () {
      alert("onclick - original onclick handler");
  }
  </code></pre>
  
  <p>However, when I log the jQuery click handler (var clickHandler = jQuery('#button').click;), I get:</p>
  
  <pre><code>  clickHandler:function (a,c){c==null&amp;&amp;(c=a,a=null);return arguments.length&gt;0?this.bind(b,a,c):this.trigger(b)}
  </code></pre>
  
  <p>Why the difference? How do I get a handle on the function so I can reassign it to another event, eg. onmousedown?</p>
  
  <p>(I need to reassign an existing js event that I have no control over, so it hasn't been added with jQuery).</p>
  
  <pre><code>    &lt;input type="text" name="name_input" id="name_input" /&gt;
      &lt;a href="#" id="button"&gt;Click&lt;/a&gt;
      &lt;script&gt;
          var input = document.getElementById("name_input");
          var button = document.getElementById("button");
          input.onchange = function(event) {
              alert("Change");
          };
  
          //reassign onclick to onmousedown
  
          button.onclick = function() {
              alert("onclick - original onclick handler");
          };
  
          //reassign onmousedown handler
          var clickHandler = button.onclick;
          // var clickHandler = jQuery('#button').click;
          console.log('clickHandler:' + clickHandler);
  
          button.onmousedown = clickHandler;
      &lt;/script&gt;
  </code></pre>