title: Parsing AJAX HTML Response: I can find the elements but not access their innerHTML or values?
body: <p>I am making an AJAX request to a .aspx script &amp; it returns HTML. I am having trouble parsing the returned HTML in JQuery, like I cannot access certain HTML element values or innerHTML.</p>
  
  <p><strong>Can you tell me what I am doing wrong &amp; how I can fix it?</strong></p>
  
  <p>I call a script test.aspx &amp; it returns just this(absolutely nothing else):</p>
  
  <pre><code>&lt;input type="hidden" id="clientIndex" value="4"&gt;&lt;/input&gt;
  &lt;div id="clientContent"&gt; ...some html &lt;/div&gt;
  </code></pre>
  
  <p>When I go to parse this HTML I am unable to access the inputs value or the divs innerHTML <strong>BUT</strong> I can access the input &amp; div objects fine(they exist).</p>
  
  <p>The code I use is:</p>
  
  <pre><code>  $.ajax(
    {
        type: "POST",
        url: "test.aspx",
        data: "i=" + $(".clientIndexClass:first").val(),
        dataType: "html"
    }).done(function (msg) {
        // NOTE: msg has the correct html so its sending back the right formatted HTML
        var index = $(msg).find("#clientIndex").val();
        var content = $(msg).find("#clientContent").html();
        // ERROR HERE: content is null &amp; index is undefined when it shd be text for both
        console.log("AJAX Response: " + index + ", " + content + ", " + msg);
  
        $(treadmill).html($(treadmill).html() + content);
  
        if (index == "-1") {
            console.log("killing intervals coz = -1");
            clearInterval(ele.ajaxInterval);
            clearInterval(ele.slideshowInterval);
        }
    });
  </code></pre>
  
  <p>In the above code I can find the objects with the ids 'clientIndex' &amp; 'clientContent' using $(msg).find("#clientIndex"); <strong>BUT</strong> I cannot access clientIndex's value? Ie, $(msg).find("#clientIndex").val(); returns null????</p>