Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

how to check if the css of my table is background-color = yellow?

Posted on 2011-10-24
7
Medium Priority
?
171 Views
Last Modified: 2012-05-12
I have a function but this function to do what it needs to do must check if a css attribute has a determine value. How to do this?

  if ($("#" + vprd).css("background-color","yellow") ..... ???

thanks
0
Comment
Question by:hidrau
  • 5
  • 2
7 Comments
 
LVL 15

Accepted Solution

by:
Eyal earned 2000 total points
ID: 37017565
almost

if ($("#" + vprd).css("background-color")=="yellow") .....

you did a set and not get
0
 
LVL 1

Author Closing Comment

by:hidrau
ID: 37017581
thanks
0
 
LVL 1

Author Comment

by:hidrau
ID: 37017650
it is strange, because the test didn't work, I have yellow in background-color and it returns that there is yellow color.

I got the value of background in the alert and it returned me this:

rgb(255, 255, 0)

is it correct?
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 1

Author Comment

by:hidrau
ID: 37017667
humm - explorer returned the name yellow, but firefox not :((
0
 
LVL 15

Expert Comment

by:Eyal
ID: 37017669
rgb(255, 255, 0) is yellow
0
 
LVL 1

Author Comment

by:hidrau
ID: 37017790
ok, but I need to prevent this too, right? two possible return

would it be:

if ($("#" + vprd).css("background-color")==rgb(255, 255, 0))  ???
0
 
LVL 1

Author Comment

by:hidrau
ID: 37017971
I got it

thanks
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
The task A number given should be formatted for easy reading by separating digits into triads. Format must be made inline via JavaScript, i.e., frameworks / functions are not welcome. So let’s take a number like this “12345678.91¿ and format i…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

580 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question