You are assigning instead of validating:
var nextBtn = document.getElementById('NextButton'),
x = new Date(),
today = new Date();
x.setFullYear(2013,9,22);
if (x === today) {
nextBtn.style.visibility = 'hidden';
} else if {
nextBtn.style.visibility = 'visible';
}
Single =
assigns, whereas ==
or ===
compares equality.
Side note:
===
is preferred (and therefore used above) because it verifies value and type. ==
verifies only value, i.e. 1 == '1'
because the values match despite one being an integer and one being a string, however 1 !== '1'
because while the value matches, the type does not. Just a little extra info.