rem: var prev = $("#first")[0].previousSibling; var p = $("#first")[0].parentNode; var result = $('#first,#firstp').wrapAll(document.getElementById('empty')); equals( $("#first").parent()[0], $("#firstp").parent()[0], "Same Parent" ); equals( $("#first").parent()[0].previousSibling, prev, "Correct Previous Sibling" ); equals( $("#first").parent()[0].parentNode, p, "Correct Parent" ); 
add: var defaultText = 'Try them out:' var result = $('#first').wrap(document.getElementById('empty')).parent(); ok( result.is('ol'), 'Check for element wrapping' ); ok( result.text() == defaultText, 'Check for element wrapping' );  reset(); $('#check1').click(function() { var checkbox = this; ok( checkbox.checked, "Checkbox's state is erased after wrap() action, see #769" ); $(checkbox).wrap( '<div id="c1" style="display:none;"></div>' ); ok( checkbox.checked, "Checkbox's state is erased after wrap() action, see #769" ); }).click(); 
context: test("wrapAll(String|Element)", function() {	expect(8);	var prev = $("#first")[0].previousSibling;	var p = $("#first")[0].parentNode;	var result = $('#first,#firstp').wrapAll('<div class="red"><div id="tmp"></div></div>');	equals( result.parent().length, 1, 'Check for wrapping of on-the-fly html' );	ok( $('#first').parent().parent().is('.red'), 'Check if wrapper has class "red"' );	ok( $('#firstp').parent().parent().is('.red'), 'Check if wrapper has class "red"' );	equals( $("#first").parent().parent()[0].previousSibling, prev, "Correct Previous Sibling" );	equals( $("#first").parent().parent()[0].parentNode, p, "Correct Parent" );	reset();	var prev = $("#first")[0].previousSibling;	var p = $("#first")[0].parentNode;	var result = $('#first,#firstp').wrapAll(document.getElementById('empty'));	equals( $("#first").parent()[0], $("#firstp").parent()[0], "Same Parent" );	equals( $("#first").parent()[0].previousSibling, prev, "Correct Previous Sibling" );	equals( $("#first").parent()[0].parentNode, p, "Correct Parent" );});
meta: 1307	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/1307/1be558203961c43043d6e9de3341e8bb9c3dcbf3/core.js/buggy/test/unit/core.js