I can’t use JQuery sadly I need to use good old Javascript.
I have a forum and a black theme and when people use black text on it you can’t see it. So I want to use javascript to change all the black text on the page to white when the page loads.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Other answerers have posted JavaScript solutions if you really want to use JS for this, so I won’t add another. However, I just thought I’d offer two alternatives:
If you find that black is the default color for any posts, and you can modify your theme, don’t use JavaScript for this — open your theme’s CSS file, try to locate the style that makes post text black, and change it to white.
If black text is simply caused by people changing the color to be such in their own posts, I think a better idea would be to just tell your members not to use black text. I can also see legitimate uses of black text on black backgrounds, e.g. for a lack of spoiler tags in your forum software.