I'm looking for some javascript code that shows whose birthday is every day. Something that tells me: "today is [xxx's] birthday" where I can set a person's name for each day/month of the year. I couldn't find anything like that, other than full calendars where the user has to pick the day or something. I only need it to tell on each day whose birthday is.
Try this. Just add the birthdays like in the example. <div id="birthday">Today's birthday: </div> <script type="text/javascript"> <!-- var birthdays = new Array(); birthdays['2006-11-14'] = 'Someone'; birthdays['2006-11-15'] = 'Someone else'; birthdays['2006-11-16'] = 'Who knows'; var date = new Date(); var day = date.getDate(); var month = date.getMonth()+1; var year = date.getFullYear(); var birthday = birthdays[year +'-'+ month +'-'+ day] ? birthdays[year +'-'+ month +'-'+ day] : 'None'; document.getElementById('birthday').innerHTML += birthday; //--> </script> Code (javascript):