[Solved] How do I add class using jquery/javascript to different elements depending on what day is it?
You don’t need jQuery to check what date it is. You can use plain Javascript for that. var today = new Date(); if(today.getDate() === 17) { $(‘.on-17’).addClass(‘active’); } A more dynamic implementation that always adds class active to the current day’s div: var today = new Date(); var dayOfMonth = today.getDate(); $(‘on-‘ + dayOfMonth).addClass(‘active’); If … Read more