title: Trouble changing width size using user input
body: <p>So i'm learning Web Development and i'm having issue taking a users input via forms and then setting the width of a container to that input. </p>
  
  <p>First i take the user input in html.</p>
  
  <pre><code>&lt;form class="changesize" action="#"&gt;
      Width: &lt;input type="text" name="width" id="txt_width"&gt;
     &lt;input type="button" name="submit" value="Change Container Size" 
     onclick="containersize();"&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>The following HTML is the container i wish to resize along with the text within it.
  <br>
      <code>&lt;div id="container"&gt;</code>
  <br>
       <code>&lt;p&gt;Lorem ipsum dolor s...&lt;/p&gt;</code>
  <br>
      <code>&lt;/div&gt;</code></p>
  
  <p>Now this is the JS which should take this input and then change the container width.</p>
  
  <pre><code>function containersize(){
    var containerwidth = document.getElementById('txt_width');
    var formatwidth = containerwidth.text + ".px";
    var container = document.getElementById('container');
    container.style.width = formatwidth;
  }
  </code></pre>
  
  <p>Please help!</p>
  
  <p>Thanks!</p>