Skip to main content
Stack Overflow
  1. About
  2. For Teams

Return to Answer

Commonmark migration
Source Link

From jQuery documentation :

.addClass(className)

className; Type: String; One or more space-separated classes to be added to the class attribute of each matched element.

Thererfore

BackgroundColor = "Background-Red";
BackgroundPattern = "Pattern-2";
TxtColor = "Txt-Color-Green";
upDateTheme();
function upDateTheme() {
 $('#Main').removeClass();
 var ClassColletion = [BackgroundColor, BackgroundPattern, TxtColor];
 var MainClasses = ClassColletion.join(' ');
 $('#Main').addClass(MainClasses);
}

Or, in a single expression :

function upDateTheme() {
 $('#Main').removeClass().addClass([BackgroundColor, BackgroundPattern, TxtColor].join(' '));
}

From jQuery documentation :

.addClass(className)

className; Type: String; One or more space-separated classes to be added to the class attribute of each matched element.

Thererfore

BackgroundColor = "Background-Red";
BackgroundPattern = "Pattern-2";
TxtColor = "Txt-Color-Green";
upDateTheme();
function upDateTheme() {
 $('#Main').removeClass();
 var ClassColletion = [BackgroundColor, BackgroundPattern, TxtColor];
 var MainClasses = ClassColletion.join(' ');
 $('#Main').addClass(MainClasses);
}

Or, in a single expression :

function upDateTheme() {
 $('#Main').removeClass().addClass([BackgroundColor, BackgroundPattern, TxtColor].join(' '));
}

From jQuery documentation :

.addClass(className)

className; Type: String; One or more space-separated classes to be added to the class attribute of each matched element.

Thererfore

BackgroundColor = "Background-Red";
BackgroundPattern = "Pattern-2";
TxtColor = "Txt-Color-Green";
upDateTheme();
function upDateTheme() {
 $('#Main').removeClass();
 var ClassColletion = [BackgroundColor, BackgroundPattern, TxtColor];
 var MainClasses = ClassColletion.join(' ');
 $('#Main').addClass(MainClasses);
}

Or, in a single expression :

function upDateTheme() {
 $('#Main').removeClass().addClass([BackgroundColor, BackgroundPattern, TxtColor].join(' '));
}
Source Link
Roamer-1888
  • 19.3k
  • 5
  • 35
  • 45

From jQuery documentation :

.addClass(className)

className; Type: String; One or more space-separated classes to be added to the class attribute of each matched element.

Thererfore

BackgroundColor = "Background-Red";
BackgroundPattern = "Pattern-2";
TxtColor = "Txt-Color-Green";
upDateTheme();
function upDateTheme() {
 $('#Main').removeClass();
 var ClassColletion = [BackgroundColor, BackgroundPattern, TxtColor];
 var MainClasses = ClassColletion.join(' ');
 $('#Main').addClass(MainClasses);
}

Or, in a single expression :

function upDateTheme() {
 $('#Main').removeClass().addClass([BackgroundColor, BackgroundPattern, TxtColor].join(' '));
}
lang-js

AltStyle によって変換されたページ (->オリジナル) /