Quick tip, I find it easier to deal with inline html like this:

```js
markup = 
    '<div>' +
        '<div>' +
            '<span>Test</span>' +
        '</div>' + 
    '</div>';
```

That makes it a bit easier to read the flow of the document.