title: How do I add DOM elements in jasmine tests without using external html files?
body: <p>I'm writing some simple jasmine tests and I'm getting an exception since the code I'm testing is looking for a form that doesn't exist because there's no DOM when testing a js file only: <code>$("form")[0]</code> in the tested js file leads to:</p>
  
  <pre><code>TypeError: $(...)[0] is undefined
  </code></pre>
  
  <p>I read a bit about jasmine-jquery and realized I can use some html fixture with an external html file. That flow seems quite messy, since all I need to do is only to add an empty valid form so that the test (which focusing on something else) will run, something like <code>&lt;form&gt;&lt;/form&gt;</code> appending would be enough I think.</p>
  
  <p>At first I thought that sandbox() function will be the solution, but it seems that it creates only divs, and I need a form.</p>
  
  <p>Any simple way to add some elements by using only code in jasmine spec file?</p>