title: Running Javascript code through NodeJS
body: <p>I need help on running javascript code through NodeJS. So far I have the following code;</p>
  
  <pre><code>txt="&lt;bookstore&gt;&lt;book&gt;";
  txt=txt+"&lt;title&gt;Everyday Italian&lt;/title&gt;";
  txt=txt+"&lt;author&gt;Giada De Laurentiis&lt;/author&gt;";
  txt=txt+"&lt;year&gt;2005&lt;/year&gt;";
  txt=txt+"&lt;/book&gt;&lt;/bookstore&gt;";
  
  parser=new DOMParser();
  xmlDoc=parser.parseFromString(txt,"text/xml");
  x=xmlDoc.getElementsByTagName("title")[0].childNodes[0];
  x.nodeValue="Diffrent Title";
  </code></pre>
  
  <p>I have it as test.js and I run it in the commant prompt as</p>
  
  <pre><code>node test.js
  </code></pre>
  
  <p>But it gives the following error:</p>
  
  <pre><code>ReferenceError: DOMParser is not defined
  </code></pre>
  
  <p>What as I doing wrong here. Can any one help please.</p>