title: Javascript to replace %0A for <br> html elements
body: <p>How can I display URL parameters to display on a new line on a HTML page using Javascript? I am working with this code below: </p>
  
  <p><code>return decodeURIComponent(pair[1].replace(/\%0A/g, "&lt;br/&gt;"));</code> 
  but unable to display the results.</p>
  
  <p>The above code is working because for example, if I <code>return decodeURIComponent(pair[1].replace(/\%20/g, " "));</code> I can see the results. Only when I use HTML elements it don't work i.e. <code>&lt;br&gt;</code>.</p>
  
  <p>Here's a full code:</p>
  
  <pre><code>function getQueryVariable(variable) {
          var query = window.location.search.substring(1);
          var vars = query.split("&amp;");
          for (var i = 0; i &lt; vars.length; i++) {
              var pair = vars[i].split("=");
              if (pair[0] == variable) {
                  return decodeURIComponent(pair[1].replace(/\%0A/g, "\n"));
              }
          }
      }
  </code></pre>
  
  <p><strong>Edit</strong>:</p>
  
  <pre><code>    getQueryVariable("line1");
      getQueryVariable("line2");
      getQueryVariable("line3");
  
  
  $(document).ready(function () {
          $(function () {
              $('#input1').val(getQueryVariable('line1')).trigger('keyup');
          });
          $('#input1').on('keyup', function () {
              var value = $(this).val();
              $("pre#one").html(value);
          });
      });
  
  &lt;input type="hidden" id="input1" /&gt;
  &lt;ul id="texts"&gt;  
      &lt;li&gt;&lt;pre id="one"&gt;&lt;/pre&gt;&lt;/li&gt;
  &lt;/ul&gt;
  </code></pre>