title: jQuery.html() with single quotes
body: <p>I can't figure out how to write this so it works. We have a page where users can upload documents and the list will show on the screen. The problem comes when the filename has a single quote in it. We are using jQuery. There's some code generation going on but this is the basics of what comes out.</p>
  
  <pre><code>$(someElement).html('&lt;label onclick="$(someOtherElement).attr(\'title\', \'TheFile\\'Name.pdf\')"&gt;Some Text&lt;/label&gt;');
  </code></pre>
  
  <p>The single quote in the file name is causing a problem. I've tried escaping it both with one backslash and 2 backslashes. With a single backslash the code runs but produces this html:</p>
  
  <pre><code>&lt;label onclick="$(someOtherElement).attr('title', 'TheFile'Name.pdf')"&gt;Some Text&lt;/label&gt;
  </code></pre>
  
  <p>which now fails on the onclick.</p>
  
  <p>With 2 backslashes, the jquery <code>html()</code> line won't run at all. In both cases I get Unexpected identifier, just at different points.</p>