title: How to use document.createElement() without defining a variable
body: <p>I'm pretty sure I already know the answer to this but I kind of would like an explanation.</p>
  
  <p>I want to create and append an element without having to define it in a variable (it seems like such a waste to me and is unnecessary).</p>
  
  <pre><code>var errorMessage = document.getElementById("errorMessage");
  
   errorMessage.innerHTML = "";
  
  errorMessage.appendChild(document.createElement('p').appendChild(document.createTextNode("Due to an egg allergy, your child will NOT receive the flu vaccine.")));
  </code></pre>
  
  <p>So this actually appends the text node into the errorMessage element, but will not generate the 'p' tag.</p>
  
  <p>I just think its ridiculous that you have to define a variable to create a new element when it's much more elegant this way. I haven't been able to find anything online about this. Does anyone know a way for this to work the way I'd like or possibly know why it won't work this way?</p>