title: JS and HTML - cloneNode() isn't working
body: <p>Below code is working as expected.</p>
  
  <p><strong>CloneNode.js</strong></p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
          &lt;body&gt;
              &lt;script src="../js/CloneNode.js"&gt;
              function myFunction(){
                  var the_node = document.getElementById("myList").lastChild;
                  var the_clone = the_node.cloneNode(true);
                  document.getElementById("myList").appendChild(the_clone);
                  }
              &lt;/script&gt;
              &lt;ul id="myList"&gt;
              &lt;li&gt;Good morning&lt;/li&gt;
              &lt;li&gt;Hello&lt;/li&gt;&lt;/ul&gt;
              &lt;p&gt;Click on the button to CloneNode()&lt;/p&gt;
              &lt;button onclick = "myFunction()"&gt;Copy it!&lt;/button&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>It is working fine for below code also :</p>
  
  <pre><code>&lt;ul id="myList"&gt;&lt;li&gt;Good morning&lt;/li&gt;
  &lt;li&gt;Hello&lt;/li&gt;&lt;/ul&gt;
  </code></pre>
  
  <p>OR</p>
  
  <pre><code>&lt;ul id="myList"&gt;&lt;li&gt;Good morning&lt;/li&gt;&lt;li&gt;Hello&lt;/li&gt;&lt;/ul&gt;
  </code></pre>
  
  <p>But when I enter newline before <code>&lt;/ul&gt;</code> in above HTML code, like below, I didn't get the output. Hence, no addition of <code>&lt;li&gt;</code> element on the webpage.</p>
  
  <pre><code>&lt;ul id="myList"&gt;
  &lt;li&gt;Good morning&lt;/li&gt;
  &lt;li&gt;Hello&lt;/li&gt;
  &lt;/ul&gt;
  </code></pre>
  
  <p>How can indentation in HTML code affect the output? Or is there anything that I've missed?</p>