Skip to content Skip to sidebar Skip to footer

Highlight Div That Contains Date

I'm trying to make code that changes the color of the div (with the class 'carrythatweight') if it has the date in it. This is the HTML I'm using:

Solution 1:

http://jsfiddle.net/37tR5/2/

I made two fixes in your code to make it work:

1) I replaced some single quotes with double quotes so that the selector gets interpolated as expected: Compare (original)

"...'' + month + '/' + day + '/' + year +'')"

with (fixed)

"...'" + month + "/" + day + "/" + year +"')"

2) I modified the class in the selector to match the class in the divs.


Post a Comment for "Highlight Div That Contains Date"