title: How can I use a multiline value for an HTML tag attribute? (i.e. how do I escape newline?)
body: <p>How do I include a newline in an HTML tag attribute?</p>
  
  <p>For example:</p>
  
  <pre><code>&lt;a href="somepage.html" onclick="javascript: foo('This is a multiline string.
  This is the part after the newline.')"&gt;some link&lt;/a&gt;
  </code></pre>
  
  <hr>
  
  <p><strong>Edit</strong>: Sorry, bad example, what if the tag happened to not be in javascript, say:</p>
  
  <pre><code>&lt;sometag someattr="This is a multiline string.
  This is the part after the newline." /&gt;
  </code></pre>
  
  <hr>
  
  <p><strong>Edit 2</strong>:  Turns out the newline in the string wasn't my problem, it was the javascript function I was calling.  FWIW, "<code>&amp;#10;</code>" can be used for newline in an HTML attribute.</p>