jquery insertbefore

jquery

Solution

Try something like

$('body').append("<div class='flora'></div>");

And if you really want to append before something... you can use the before() method.

$('something').before("<div class='flora'></div>");

Problem

I have a simple jQuery question. How come I can't do this? ``` $("<div class='flora'></div>").insertBefore('</body>'); ``` I just want to add a new div at the end of the HTML page. So I thought I'd use the .insertBefore method, but jQuery seems to not like to target the `</body>` tag. thoughts? Thanks!

Original source