title: document.createElement('p').setAttribute('onclick', 'view()') not working
body: <p>I am having a slight problem with the .setAttribute command. I am creating an element called view:</p>
  
  <pre><code>var view = document.createElement('p')
  view.innerHTML = "VIEW"
  view.style.color = "#e60f0f"
  view.style.fontFamily = "Montserrat"
  view.style.fontWeight = "600"
  view.style.fontSize = "13px"
  view.style.right = "5px"
  view.style.position = "absolute"
  view.style.top = "0px"
  view.style.marginTop = "5px"
  view.style.backgroundColor = "transparent"
  view.style.padding = "10px"
  view.style.borderRadius = "7px"
  view.setAttribute('onclick', 'view(name, date, type)')
  document.getElementById(newId).appendChild(view)
  </code></pre>
  
  <p>When I run this, everything renders except the .setAttribute() function. I don't have the sligthest idea why. Does anyone know? Thank you SO much!</p>
  
  <p>Here's the view() function in case you need it:</p>
  
  <pre><code>function view(name, date, type) {
    window.location = '/flightStatus?name=' + name + '&amp;date=' + date + '&amp;type=' + type
  }
  </code></pre>
  
  <p><em>Just as another note: I am sending this to Node.js... I don't think that matters, the code above is client-side :)</em></p>