title: Get specific content off responseText
body: <p>I am making an ajax call and I get the content from <code>responseText</code>.</p>
  
  <p>I confirm by using <code>alert</code> that inside, the <code>responseText</code> contains the entire page as a <code>string</code>.</p>
  
  <p>That's fine. Now I need to extract specific contents from the string by converting it to DOM and using <code>getElementsByTagName</code>, <code>getElementsByName</code> etc...</p>
  
  <p>My problem is that none of these seems to work.</p>
  
  <p>I've read many references on using <code>responseXML</code> instead of <code>responseText</code> but this gives me back <code>null</code>.</p>
  
  <p>So, by sticking to <code>responseText</code>, how can i get the specific elements that I want?</p>
  
  <p>For instance if my response contains the following:</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;....&lt;/head&gt;
  &lt;body&gt;....
   .....
   &lt;table&gt;
   &lt;tr&gt;
   &lt;td&gt;sometext&lt;/td&gt;
   &lt;td&gt;someothertext&lt;/td&gt;
   &lt;/tr&gt;
   &lt;tr&gt;
   &lt;td&gt;sometext&lt;/td&gt;
   &lt;td&gt;someothertext&lt;/td&gt;
   &lt;/tr&gt;
   &lt;tr&gt;
   &lt;td&gt;sometext&lt;/td&gt;
   &lt;td&gt;someothertext&lt;/td&gt;
   &lt;/tr&gt;    
   &lt;/table&gt; 
   &lt;div&gt; somediv &lt;/div&gt;
   &lt;/body&gt;
   &lt;/html&gt;     
  </code></pre>
  
  <p>how can I access the second row of the table and its value? Or the div etc..
  so, now in my actual html, i have sth like this</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;.....&lt;/head&gt;
  &lt;body&gt;
  &lt;table&gt;&lt;tr&gt;&lt;td id="test"&gt;Test&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>i want the extracted element/value to be parsed inside the table of my actual html..</p>
  
  <p>document.getElementById('test').innerHTML = the_extracted_elements_from_responseText</p>