Happy to help. I would like to make sure you understand why that code works.
-
The date value is generated and set as the content for the
span
element. -
The jQuery selector looks for the span (
each
is a loop) and saves its content ascellValue
, i.e. the date value. -
To get the parent
th
element of thespan
we use theparent()
jQuery function. -
Instead of coloring
$(this)
which is the span, we color$(this).parent()
which is theth
parent element.
Let me know if you are done with my Codepen, you can fork it (fork button at the footer) and I will delete it.