Hello Stackoverflow community, I want to use JavaScript to display a paragraph when today is Wednesday. I have already tried but have not managed to do it
I already tried this:
var weekday = Wednesday.getDay();
var options = { weekday: 'long'};
console.log(new Intl.DateTimeFormat('en-US', options).format(Wednesday));
if (Date.prototype.getDay() = 2) {
answer = "yes it is wednesday"
} else {
answer = "it isn't wednesday"
}
$("#output").html(answer);
Now I don't know what to do because I am a beginner with JavaScript and HTML