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

sqlite3 - UPDATE a table from the SELECT of another one -

c# - Showing a SelectedItem's Property -

javascript - Render HTML after each iteration in loop -