title: Trying to parse xml file for javascript quiz
body: <p>I am trying to create a javascript quiz, that gets the questions from a xml file. At the moment I am only starting out trying to parse my xml file without any success. Can anyone point me to what I am doing wrong?</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;title&gt;Test&lt;/title&gt;
  &lt;script type="text/javascript" src="prototype.js"&gt;&lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;div class="spmArr"&gt;
  &lt;/div&gt;
  &lt;script type="text/javascript"&gt;
  var quizXML = '&lt;quiz&gt;&lt;Sporsmal tekst="bla bla bla"/&gt;&lt;alternativer&gt;&lt;tekst&gt;bla&lt;/tekst&gt;&lt;tekst&gt;bli&lt;/tekst&gt;&lt;tekst correct="yes"&gt;ble&lt;/tekst&gt;&lt;/alternativer&gt;&lt;Sporsmal tekst="More blah"/&gt;&lt;alternativer&gt;&lt;tekst&gt;bla bla&lt;/tekst&gt;&lt;tekst correct="yes"&gt;bli bli&lt;/tekst&gt;&lt;tekst&gt;ble ble&lt;/tekst&gt;&lt;/alternativer&gt;&lt;/quiz&gt;'
  
  var quizDOM = $.xmlDOM( quizXML );
  
  quizDOM.find('quiz &gt; Sporsmal').each(function() {
  
  var sporsmalTekst = $(this).attr('tekst');
  var qDiv = $("&lt;div /&gt;")
  .addClass("item")
  .addClass("sporsmal")
  .appendTo($(".spmArr"));
  var sTekst = $("&lt;h2/&gt;")
  .html(sporsmalTekst)
  .appendTo(qDiv);
  });
  &lt;/script&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>When I try this in my browser the classes and div are not being created. And the page is just blank. Am i doing something wrong when I intialize the xml?</p>
  
  <p>edited to add prototype.js and close function</p>