/*
* jQuery @VERSION - New Wave Javascript
*
- * Copyright (c) 2006 John Resig (jquery.com)
+ * Copyright (c) 2007 John Resig (jquery.com)
* Dual licensed under the MIT (MIT-LICENSE.txt)
* and GPL (GPL-LICENSE.txt) licenses.
*
// Handle HTML strings
if ( typeof a == "string" ) {
- // HANDLE: $(html) -> $(array)
var m = /^[^<]*(<.+>)[^>]*$/.exec(a);
- if ( m )
- a = jQuery.clean( [ m[1] ] );
+
+ a = m ?
+ // HANDLE: $(html) -> $(array)
+ jQuery.clean( [ m[1] ] ) :
- // HANDLE: $(expr)
- else
- return new jQuery( c ).find( a );
+ // HANDLE: $(expr)
+ jQuery.find( a, c );
}
return this.setArray(
* This function also accepts XML Documents and Window objects
* as valid arguments (even though they are not DOM Elements).
*
- * @example $(document).find("div > p")
- * @before <p>one</p> <div><p>two</p></div> <p>three</p>
- * @result [ <p>two</p> ]
- * @desc Same as $("div > p") because the document
- *
* @example $(document.body).background( "black" );
* @desc Sets the background color of the page to black.
*