Jquery Add div inside h1 tag

html, jquery

Solution

Try to use use `$('h1').wrapInner('<div class="wrap" />');`

But use a `<span class="wrap" />`

Demo jsBin

From the DOCS: http://api.jquery.com/wrapInner/

Problem

Using jquery, How would I wrap a div class around the text inside all h1 tags. E.g to make all `<h1> test </h1>` in a document into `<h1> <div class="wrap">test </div></h1>`. I am having a mental block. Any help would be much appreciated.

Original source