I have been diligently working on this piece of code for a while now. I have carefully placed alerts to debug it and ensured that the flow is correct. The necessary styles are all in place. Initially, the body starts with the "styleBlack" class. When the if statement condition is met, the body's class changes to "styleLight". However, despite meeting the else statement condition during a second call, the innerHTML of mDiv remains unchanged, as does the class of the body.
function ColorSwap() {
var mDiv = document.getElementById("m_divSwap");
if (mDiv.innerHTML = "Go Light") {
mDiv.innerHTML = "Go Dark";
document.body.className = "styleLight";
} else {
mDiv.innerHTML = "Go Light";
document.body.className = "styleBlack";
}
}