title: If I set `let x = document.getElementById("inputText").value` and update `x`, why doesn’t the value update?
body: <p>In the following example, why doesn’t the <code>value</code> property of the input with the ID <code>test</code> update to <code>&quot;second&quot;</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>document.getElementById("test").addEventListener("click", () =&gt; {
    let test = document.getElementById("test").value;
    
    test = "second";
    console.log(test); // Logs "second", but input value is not updated.
  });</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;label&gt;Click on this test input: &lt;input type="text" id="test" value="first"&gt;&lt;/label&gt;</code></pre>
  </div>
  </div>
  </p>