something like this

var mycolor = "#000";
$("h1").css({color:mycolor });

this is your statement

'color', ' + color + '

it should be

color:color

On Tue, Jun 2, 2009 at 8:50 PM, jeff <jeffreykarbow...@gmail.com> wrote:

>
> Hello, I am trying to get the color of an element and change the color
> of another element with that color. Does this make sense?
>
> What is wrong with this? I would like all of the H1 tags to inherent
> the color of ".ui-state-error". Thank you in advance!
>
> $(function(){
>                   var color = $('.ui-state-error').css('color');
>                   $("H1").css({'color', ' + color + '});
>                   });
>
>

Reply via email to