title: Changing text color via function
body: <p>I have been trying to change the text color via one that was input and thrown into a function, but I have no clue where I am going wrong. I have used reference code and changed a value or two around, so I assume I messed something up. Here's the code I'm having trouble with:</p>
  
  <pre><code>&lt;form&gt;
      &lt;input id="newColor" type="text"&gt; &lt;button value="Text" onclick="changeText(tColor)"&gt;Text&lt;/button&gt;
  &lt;/form&gt;
  &lt;br&gt;
  &lt;div id="divTag"&gt; 
  THIS TEXT HERE
  &lt;/div&gt;
  &lt;script&gt;
      function changeText(tColor) 
      {
          document.getElementById("newColor").value = tColor.value;
          document.getElementById("divTag").style.backgroundColor = tColor;
       }
   &lt;/script&gt;
  </code></pre>
  
  <p>This is really troubling me. I also need to change the page background color but since it's in the same manner I could just learn based off of this code. Can anybody help me out?</p>