Click here to Skip to main content
15,891,773 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i want to get element by its background color like this..
$('tr [background-color = red] ').
Posted
Updated 21-Aug-14 0:07am
v2

Hi Kiran

-- If you are using background-color as an custom "attribute" then you can select like billow.
$("tr[background-color='red']")
.
-- If you are using css or style element on that you need to use css selector.

Thanks
 
Share this answer
 
v2
Below code will help you

JavaScript
$( "*" ).css( "background-color", "red" )


To test you can use the length attribute. Like below

JavaScript
$( "*" ).css( "background-color", "red" ).length
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900