1
rated 0 times
[
7]
[
6]
/ answers: 1 / hits: 19829
/ 13 Years ago, wed, november 9, 2011, 12:00:00
I am trying to set a background color for an ID + Variable but I can't figure it out. There must be something really small that I am not aware of.
Here is what I have:
var abc = $dialog.data( url );
alert(abc)
This Alerts: item1
var cde = '#' + abc
alert(cde)
This Alerts: #item1
So far so good. Now, I'm trying to change the background for that ID.
So:
This works:
$(body).css('background-color', 'black');
This doesn't:
cde.css('background-color', 'black');
$(cde).css('background-color', 'black');
$(# + abc).css('background-color', 'black');
All are in the same function.
What I'm I doing wrong?
Thanks a lot
More From » jquery