Changing all CSS styles with a property via Jquery

Posted by Joe on Stack Overflow See other posts from Stack Overflow or by Joe
Published on 2010-03-28T09:13:31Z Indexed on 2010/03/28 9:23 UTC
Read the original article Hit count: 207

Filed under:
|
|

On a page I include some css eg:

<style type='test/css'>
.myBox{
color:#000000;
border:#FFFFFF;
padding:4px;
}
.myBox2{
color:#000000;
border:#FFFFFF;
padding:4px;
}
</style>

I want to then change the "color" property set within both myBox and myBox2 in jquery, without knowing the actual name (myBox, myBox2) of the css style. In otherwords, I want to update ALL css styles on the page where color = certain value, and then also update border where = certain value.

An example (not valid code) might be:

$("all css [color:#000000]").html("#FF0000");

How could this be possible using jquery?

© Stack Overflow or respective owner

Related posts about css

Related posts about stylesheet