I'm wondering if anyone could help me with this code. I'm trying to display a photo based on the current month.
function pictures(){
document.getElementById('pics');
var m= new Date();
var month=d.getMonth();
switch (month){
case (0):
var img=new Image();
img.src="Holiday/HolidayDesktops/Newyear.jpg";
break;
case(1):
var img=new Image();
img.src="Holiday/HolidayDesktops/Vday.jpg";
break;
case(2):
var img=new Image();
img.src="Holiday/HolidayDesktops/St.Patday.jpg";
break;
case(3):
var img=new Image();
img.src="Holiday/HolidayDesktops/Easter.jpg";
break;
case(4):
var img=new Image();
img.src="Holiday/HolidayDesktops/MemorialDay.jpg";
break;
case(5):
var img=new Image();
img.src="Holiday/HolidayDesktops/NatFlagDay.jpg";
break;
case(6):
var img=new Image();
img.src="Holiday/HolidayDesktops/July4.jpg";
break;
case(7):
var img=new Image();
img.src="Holiday/HolidayDesktops/WomensEqualityDay.jpg";
break;
case(8):
var img=new Image();
img.src="Holiday/HolidayDesktops/LaborDay.jpg";
break;
case(9):
var img=new Image();
img.src="Holiday/HolidayDesktops/Halloween.jpg";
break;
case(10):
var img=new Image();
img.src="Holiday/HolidayDesktops/Thanksgiving.jpg";
break;
case(11):
var img=new Image();
img.src="Holiday/HolidayDesktops/Christmas.jpg";
}
}
<img src="Holiday/HolidayDesktops/July4.jpg" id="pics">