title: Set Input Value to Javascript Variable
body: <p>Let's say I have a variable called x in javascript. How can I set the value of a text input (HTML) to that variable? For example: </p>
  
  <p>The value of the input will now be Swag</p>
  
  <pre><code>&lt;input type="text" value="Swag" /&gt;
  </code></pre>
  
  <p>But if I want the value to be a javascript variable? How do I do? Something like this? (I am just guessing, trying to make my point clear) </p>
  
  <pre><code>&lt;input type="text" value="variable.x" /&gt;
  </code></pre>