title: document.getElementById().textContent not working with variable
body: <p>When I use document.getElementById().textContent to set the "text content" to the value of a variable it doesn't work it doesn't to anything instead changing the text content to the value of the variable. It does work when I use </p>
  
  <pre><code>.textContent = "example";
  </code></pre>
  
  <p>but not</p>
  
  <pre><code>.textContent = example;
  </code></pre>
  
  <p>Here is my HTML</p>
  
  <pre><code>&lt;head&gt;
     &lt;link rel="stylesheet" type="text/css" href="style.css"&gt;
     &lt;script language="javascript" type="text/javascript" src="testScript.js"&gt;&lt;/script&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
     &lt;p class="heading"&gt;Heading&lt;/p&gt;
     &lt;p id="TextSpace"&gt;&lt;/p&gt;
  
  
  &lt;/body&gt;
  </code></pre>
  
  <p>Here is my JS</p>
  
  <pre><code>//Get users name
  var name = prompt("What is you name");
  //put the name in the element "text space"
  document.getElementById("TextSpace").textContent = name;
  </code></pre>
  
  <p>The prompt appears but after that nothing happens</p>