title: Does javascript have an Equivalent to C#s HttpUtility.HtmlEncode?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/1219860/javascript-jquery-html-encoding">JavaScript/jQuery HTML Encoding</a>  </p>
  </blockquote>
  
  
  
  <p>I am passing info down to the client as Json and I am generating some HTML from my javascript code.  I have a field called name which I pass into the title of an image like this:</p>
  
  <pre><code>  html.push("&lt;img  title='" + person.Name + "' src . . . 
  </code></pre>
  
  <p>the issue is if the person.Name is "Joe O'Mally' as it only shows up as "Joe O" when i hover over the image (because of the ' in the name)</p>
  
  <p>I don't want to strip the ' on the serverside as there are other places where I want to show the exact string on the page.</p>
  
  <p>Is there an Equivalent of HttpUtility.HtmlEncode in javascript that will show the full name in the image title, when I hover of the image?</p>