JavaScript Question

Status
This thread has been locked.
PebbleHost
High performance, consistent uptime and fast support. Minecraft hosting that just works.

Lyfe

Supreme
Feedback score
37
Posts
983
Reactions
417
Resources
0
document.querySelector("Header").style.color = "green";
 

Lyfe

Supreme
Feedback score
37
Posts
983
Reactions
417
Resources
0
Jus tried that it dont work Dont work
That code definitely works, so there's something else causing a problem. Check these 2 things:

1) Are you sure the class is "Header" and not "header" and that it's a class but not an ID?
2) Does it have a tag inside it (p, a, etc) that you should set the color on instead?
3) Is there another style that is overriding it? Try setting it to document.querySelector("Header").style.color = "green !important"; and make sure there are no important statements in the CSS that override that. If this works, don't keep the !important (bad practice) but instead remove the conflicting CSS style.

If this still doesn't work, send me the code and I'll take a look over it for you.
 
Status
This thread has been locked.
Top