title: Javascript: setAttribute() v.s. element.attribute = value to set "name" attribute
body: <p>So I'm learning to manipulate the DOM and I noticed one interesting thing:</p>
  
  <p>Let's say I want to set the <code>name</code> attribute of an element by using the "." dot notation:</p>
  
  <pre><code>element.name = "someName";
  console.log(document.getElementsByName("someName")[0]); // returns "undefined"??
  </code></pre>
  
  <p>However if I use the <code>document.setAttribute()</code> method, it works fine:</p>
  
  <pre><code>element.setAttribute("name", "someName");
  console.log(document.getElementsByName("someName")[0]); // returns the element like it should.
  </code></pre>
  
  <p>Not sure why the dot notation method doesn't work in the first case. </p>
  
  <p>Why does this happen?</p>