Unable to change background color using jquery -


I have a table in which I have numeric boxes, and some of them have a value of 0 if the preload is already done.

I want to change the background color of those boxes in which the value of 0 when the page is loaded. Below the code I am using, but this is not working for me, please suggest.

  if ($ ('tr td'). Children ('input'). Val () == 0) $ (this). CSS ('background-color', '#CCCCC');  

Here you go (using jquery version 1.11):

 ($ (This) .text () === '0') {$ (this) .css ('background-color', 'black');}});  

Examples of working:


Comments

Popular posts from this blog

Member with no value in F# -

java - Joda Time Interval Not returning what I expect -

c# - Showing a SelectedItem's Property -