What is the return value of .wrap() ?
Hi,
I took a wild guess and thought the following code would return the new wrapper as an object:
- var objWrapper = $("p").wrap("<div />");
and that I could continue working with objWrapper, for example:
- objWrapper.css("padding", "5px");
but I couldn't. What I need to do is:
- $("p").wrap("<div id='wrapper' />");
- var objWrapper = $("#wrapper");
- objWrapper.css("padding", "5px");
This, to me, looks like an extra roundtrip to the DOM. So my question is: Is this by design, or am I doing something wrong?
Stian