title: Using HTML tags in JavaScript strings while complying with W3C rules
body: <p>Here's my code:</p>
  
  <pre><code>&lt;a href="#"&gt;
      &lt;img src="myimage.jpg" 
       onmouseover="showDescription(
            'Text', 'Text with HTML tags in them&lt;br /&gt;More text');" 
       onmouseout="revertDescription();" 
       alt="Image description"&gt;
  </code></pre>
  
  <p>The W3C Markup Validator doesn't like this. It doesn't want HTML tags inside my JavaScript code. Here's the error message it produces if I attempt this:</p>
  
  <blockquote>
    <p>character "&lt;" is the first character of a delimiter but occurred as data</p>
  </blockquote>
  
  <p>How can I fix this while making sure that my page doesn't mess up if I pass the HTML tag-containing string to <code>document.getElementById('myElement').innerHTML</code>?</p>