Create DOM element from jQuery selector
问题 I was wondering if it were possible to, instead of selecting an element from the DOM via a jQuery selector, if I can create one instead. For example: $.create('#hello').insertAfter('#test'); would generate the following: <div id="test">This element already existed in the DOM.</div> <div id="hello"></div> Or, better yet, for more complex operations: $.create('#test.a.b'); for: <div id="test" class="a b"></div> Obviously, more complex operations like :selected or :nth-child or :not() and all of