title: Can you set multiple attributes with the DOM's setAttribute function?
body: <p>Let's say I wanted to create an input element using the DOM. Instead of doing something like this</p>
  
  <pre><code>var input = document.createElement("input");
  input.setAttribute("class", "my-class");
  input.setAttribute("type", "checkbox");
  input.setAttribute("checked", "checked");
  </code></pre>
  
  <p>Is there a DRYer way to write these three lines of code into one line.</p>
  
  <p>I know you could do something like this</p>
  
  <pre><code>var attributes = ["class", "type", "checked"];
  var values = ["my-class", "checkbox", "checked"];
  
  for (var i = 0; i &lt; attributes.length; i++) {
    input.setAttribute(attributes[i], values[i])
  end
  </code></pre>
  
  <p>The problem is that is only helpful if you have a boatload of attributes you need to add. If you only have two or three, this is even less DRY.</p>
  
  <p>Is there anyway I can dry up this code?</p>