Wrap HTML around existing items using jQuery wrap


If you are working on a website and have limited access to modifying the DOM and you need to wrap a div around a ul, then sometimes you need a little help. jQuery wrap is an awesome partner for this. Here is a quick way to wrap existing HTML using jQuery.

[code language=”javascript”]

$( ".ui-tabs-nav" ).wrap( "<div class=’tabWrapper’></div>" );

[/code]

Tags: , , ,