tbranyen/backbone.layoutmanager — pull request #188 by steverandy (2012-10-23 18:39:26+00:00)
Title: Example for replaceWith

For setView, I think it is more appropriate to use replaceWith() instead of html().
The main reason for this is because I tend to set an ID for a view and I would have the same element with the same ID in the layout.
If we use html() the result will be:

```

```

On this example, which I copied from basic.html, the div tag is wrapped with a p tag. That is not a valid HTML.

Using html()

![](http://i.imgur.com/Kewti.png)

Using replaceWith()

![](http://i.imgur.com/vTHEu.png)