Question: ```
var div = document.createElement("tempdiv");
div.innerHTML = "<html><body><div id='test'>Hello World!</div></body></html>";
alert(div.getElementById("test").innerHTML);

```

I get the error "*Uncaught TypeError: Object #HTMLUnknownElement has no method 'getElementById'*"

Answer: 
The [`getElementById`](https://developer.mozilla.org/en-US/docs/DOM/document.getElementById) method only exists on the document object. It is not supported by individual DOM elements. If you were to add the element to the DOM, you could call `document.getElementById("test").innerHTML;` to get your text.
Don't forget to set an Id in to the created div to be able to select:

```
var div = document.createElement("div");
div.setAttribute('id', 'idName');
div.innerHTML = "<html><body><div id='test'>Hello World!</div></body></html>";

```