X-Git-Url: http://git.asbjorn.it/?a=blobdiff_plain;f=src%2Fjquery%2Fjquery.js;h=88930f227a4c6875b7eee5289617f57e90c2ea3b;hb=8937e088b6f06a0dbef36348aef5d7c10f3af340;hp=7f7ef08d1089f80fefcb767f037cddb58752886a;hpb=b8d46f7b6a38d92d9e0ad0b0df12c773bcf1c634;p=jquery.git diff --git a/src/jquery/jquery.js b/src/jquery/jquery.js index 7f7ef08..88930f2 100644 --- a/src/jquery/jquery.js +++ b/src/jquery/jquery.js @@ -1235,28 +1235,21 @@ jQuery.extend({ }, className: { - add: function(o,c){ - if (jQuery.className.has(o,c)) return; - o.className += ( o.className ? " " : "" ) + c; + add: function( elem, c ){ + if ( jQuery.className.has( elem, c ) ) + return; + elem.className += ( elem.className ? " " : "" ) + c; }, - remove: function(o,c){ - if( !c ) { - o.className = ""; - } else { - var classes = o.className.split(" "); - for(var i=0; iHello

* @result [

Hello

] * + * @example $("p").removeClass("selected") + * @before

Hello

+ * @result [

Hello

] + * * @name removeClass * @type jQuery - * @param String class A CSS class to remove from the elements + * @param String class (optional) A CSS class to remove from the elements * @cat DOM */ removeClass: function(c){ @@ -3286,4 +3295,4 @@ jQuery.macros = { } }; -jQuery.init(); +jQuery.init(); \ No newline at end of file