return this.pushStack( Array.prototype.slice.apply( this, arguments ) );
},
- map: function(fn){
+ map: function(fn) {
return this.pushStack(jQuery.map( this, function(elem,i){
return fn.call( elem, i, elem );
}));
},
+
+ andSelf: function() {
+ return this.add( this.prevObject );
+ },
- domManip: function(args, table, dir, fn){
+ domManip: function(args, table, dir, fn) {
var clone = this.length > 1, a;
return this.each(function(){
// Convert html string into DOM nodes
if ( typeof arg == "string" ) {
+ // Fix "XHTML"-style tags in all browsers
+ arg = arg.replace(/(<(\w+)[^>]*?)\/>/g, function(m, all, tag){
+ return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area)$/i)? m : all+"></"+tag+">";
+ });
+
// Trim whitespace, otherwise indexOf won't work as expected
var s = jQuery.trim(arg).toLowerCase(), div = doc.createElement("div"), tb = [];