title: getAttribute(attr) method in Java Script returning previous value of attribute
body: <p>Unable to get why elem.getAttribute("someAttribute") doesn't return updated value.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;body&gt;
    &lt;input type="text" value="previousValue"&gt;
    &lt;script&gt;
      var input = document.body.children[0]
   
      input.value = 'newValue'
   
      alert(input.getAttribute('value')) // 'previousValue', not changed!
    &lt;/script&gt;
  &lt;/body&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>Can anyone explain this?</p>