Response title
This is preview!
Hi,
I took a wild guess and thought the following code would return the new wrapper as an object:
and that I could continue working with objWrapper, for example:
but I couldn't. What I need to do is:
$("p").wrap("<div />") returns $("p") instead of $("<div/>"). I think it is make sense to return the original object instead of the new one.
If you want to access the new div, use this
$("p").wrap("<div/>").parent().css("padding","5px");
© 2013 jQuery Foundation
Sponsored by and others.