variable holding style value can't be changed
<p>I am curious about a simple problem. Here is the code:</p>

<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>var square = document.getElementById('square')
var left = square.style.left

function moveNoVariable() {
  square.style.left = "100px" // works
}

function moveWithVariable() {
  left = "100px" // doesn't work
}

moveNoVariable()</code></pre>
<pre class="snippet-code-css lang-css prettyprint-override"><code>#square {
  width: 20px;
  height: 20px;
  border: 1px solid black;
  background-color: red;
  position: relative;
}</code></pre>
<pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div id="square"&gt;&lt;/div&gt;</code></pre>
</div>
</div>
</p>

<p>I am just wondering why the style won't change if I use "left" even though it is storing the correct value.</p>

<p>Thanks.</p>