What is the return value of .wrap() ?

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:

  1. var objWrapper = $("p").wrap("<div />");

and that I could continue working with objWrapper, for example:

  1. objWrapper.css("padding", "5px");

but I couldn't. What I need to do is:

  1. $("p").wrap("<div id='wrapper' />");
  2. var objWrapper = $("#wrapper");
  3. 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