My calendar design utilizes three different classes to style its child elements: "old day", "day", and "new day". However, I am facing an issue where using querySelectorAll with the class name "day" also captures the other two classes. This becomes problematic when trying to specifically target only the "day" class without selecting "old day" or "new day."
t = document.getElementByTagName('table');
d = t.item(0).querySelectorAll('.day');
for (i = 0; i < d.length: i ++) {
if(d[i].textContent == 28) {
d[i].click();
}
}
This leads to clicking on the old month's 28th instead of the current month's 28th. How can I accurately select only the "day" class of td element without unintentionally including "old day" and "new day"?