This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

check tr background color  RSS feed

 
Edward Chen
Ranch Hand
Posts: 798
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how to judge a tr background color ?


in the coding above, it always shows "ffffffffffffff", but actually it sets and displays tr background color as "#66FF99".

The logic is , first time user clicks one tr, it change background color, when user clicks it again (like unselect), the color will be changed back.

Thanks.
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
debug this:

alert(tr.style.backgroundColor);

what does it say

Eric
 
Edward Chen
Ranch Hand
Posts: 798
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
--- #66FF99
Maybe some empty space? I need to trim it?

Thanks.
 
Eric Pascarello
author
Rancher
Posts: 15385
6
 
Liu Zhixiang
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you sure it's #66FF99 (instead of #66ff99 )?


Eric's method is good!
[ September 21, 2006: Message edited by: Liu Zhixiang ]
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!