title: Adding HTML code inside JavaScript variable?
body: <p>I was simply wondering how I would add html code inside a javascript variable? For example, I want to use HTML code (a <code>&lt;a href="/example.html"&gt;</code> link piece of code) in one of the message lines:</p>
  
  <pre><code>var messages = [
  "Please wait while we handle your request...",
  "This is taking longer than usual to process - please wait...",
  "We seem to be having trouble - please click here to contact support"
  ];
  
  $.each(messages, function(index, message) {
  setTimeout(function() {
      $('#wrapper').append(
          $('&lt;p /&gt;', {text : message})
      )
  }, index * 1500); // 1.5 seconds, add a zero for 15 seconds
  });
  </code></pre>
  
  <p>So it would be like:</p>
  
  <pre><code>var messages = [
  "Please wait while we handle your request...",
  "This is taking longer than usual to process - please wait...",
  "We seem to be having trouble - please click &lt;a href="/help.html"&gt;here&lt;/a&gt; to contact support"`
  </code></pre>
  
  <p>Is there a way of doing this?</p>