src code

class method Element.wrap

Element.wrap(element, wrapper[, attributes]) → Element
  • wrapper (Element | String) – An element to wrap element inside, or else a string representing the tag name of an element to be created.
  • attributes (Object) – A set of attributes to apply to the wrapper element. Refer to the Element constructor for usage.

Wraps an element inside another, then returns the wrapper.

This method can be called either as an instance method or as a generic method. If calling as a generic, pass the instance in as the first argument.