.wrapChildren( "Wrapper_Tag_Name", [ Properties ]) - Add a Wrapper for all child element
.wrapChildren() will wrap all the child elements of a parent element and the wrapper will be the new immediate parent for children. It can set attributes to the wrapper using the second parameter.
Parameters
NameTypeDefaultPossible ValuesDescription
Wrapper_Tag_NameStringTag NamesWrapper tag names
PropertiesJSONAttributes for Elements Attribute names and values will be set for the new wrapper element. "text" property will set inner Text content.
Returns
NameTypeDescription
wrapper element$.ObjsAfter wrapping child elements, wrapper will be converted to Nedil Object and returned.
Example 1
Clicking on "Add Wrapper" button will wrap all the children of the parent div.
JS HTML CSS
		$.domLoaded(function() {

			$.get("#add").on("click", function() {
			
				//add a wrapper to all children of #parent
				$.get("#parent").wrapChildren("div", {
					"class" : "wrapper",
					"text" : "Wrapper and New Parent"
				});
				
			});
			
		});						
						
<body>

<div id="parent"> 
Parent
	<div class="child">child</div>
	<div class="child">child</div>
	<div class="child">child</div>

</div>
<br/>
<input type="button" id="add" value="Wrap Parent Children" />

</body>
		#parent {
			display : inline-block;
			background-color : #fff;
			border : 2px solid red;
			padding : 10px;
		}
		
		.child {
			width : 70px;
			height : 50px;
			margin : 5px;
			background-color : #0af;
		}
		
		.wrapper {
			background-color : yellowgreen;
			padding : 20px;
		}
Result