title: Setting multiple attributes for an element at once with JavaScript
body: <p>How can I set multiple attributes at once with JavaScript? Unfortunately, I'm not able to use a framework like jQuery on this project. Here is what I have now:</p>
  
  <pre><code>var elem = document.createElement("img");
  
  elem.setAttribute("src", "http://example.com/something.jpeg");
  elem.setAttribute("height", "100%");
  elem.setAttribute("width", "100%");
  </code></pre>