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(' '));
}
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(' '));
}