I am trying to add a div around "the here is some text" area of the example below
I was thinking of doing this by finding nav until menucontainer and wrapping it in a div. But this isn’t working.
HTML
<nav id="mainNav">
here is some text
<div id="menucontainer"> test</div>
</nav>
jQuery
jQuery(document).ready(function() {
jQuery("#mainNav").nextUntil("div#menucontainer").wrapAll( jQuery("<div></div>").addClass("newDiv") );
});
The new div doesnt get appended though and I am not sure why?
Javascript
Demo