How to get the wrapper element created with "wrapAll()"?
The jQuery object stored in wrapper
gets cloned when wrapAll
gets called, so you cannot affect the .wrappers
which have been inserted into the DOM by manipulating wrapper
, you need to select them from the document.
Since you just wrapped the elements, you can use parent() to obtain the newly inserted wrappers:
$(".a").wrapAll("<div class='wrapper'></div>")
.parent().css("border", "5px solid black");