title: When jQuery .attr('onclick') function return a event object?
body: <p>I am just debugging jQuery in FireBug and wonderig about the return value of </p>
  
  <pre><code>$('.a-selector').attr('onclick');
  </code></pre>
  
  <p>It turns out to be an <code>onclick(event)</code>, but I have read some code before and the author just uses it like this:</p>
  
  <pre><code>$('.a-selector').attr('onclick').replace(..., ...);
  </code></pre>
  
  <p>which means it can be treated as a String Object. But it reports an error when I use like this.</p>
  
  <p>My jQuery version is 1.5.2. So I wonder when the jQuery changes the API and what is the best way to change the <code>onclick</code> event defined in the HTML. </p>