If you create a lot of dom elements dynamically, the standard jQuery method of wrapping an open tag in an instance can be cumbersome. Here’s some sugar I use pretty frequently:

The above will accept a tag name, with an optional subset of selectors for class and ID, and return a DOM element wrapped in a jQuery instance.

The above will return a DIV element, with an ID of “main” and 2 classes: “wrapper” and “col”.

Additionally, I use a convenience instance method for direct adoption:

So the following would append a new P element with 3 class names to the DOM tree of the invoking instance: