title: Set attributes of node created from template element
body: <p>The below code fails with console error <code>Uncaught TypeError: node.setAttribute is not a function</code>. How can I change the attributes of nodes created from templates?</p>
  
  <pre class="lang-js prettyprint-override"><code>const template = document.createElement("template");
  template.innerHTML = `&lt;div&gt;hello&lt;/div&gt;`;
  const node = template.content.cloneNode(true);
  document.body.appendChild(node);
  node.setAttribute("style", "background-color: green;")
  </code></pre>