AJAX - Accessing id values inside responseText after statechange

A little AJAX fun, been messing with this for the past two days:

request = new XMLHttpRequest();

request onreadystatechange = function(){
        if(request.readyState == 4){
            var ajaxDisplay = document.getElementById('displayDiv');
           ajaxDisplay.innerHTML = request.responseText;
        }
}

Now here’s the problem. After I have set displayDiv to whatever the responseText was, I can’t access the id’s inside it using document.getElementById. I get the nice “…has no display properties” error because the document physically does not contain the responseText.

I know other people have run into this problem, and I am wondering what you did to fix it :slight_smile: