New filters on the Home Feed, take a look!
view details

This post has been de-listed

It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.

4
Adding to 'style' using JQuery ?
Post Body

This is an addon, so it's modifying an existing page. I want to define a new css class, so that I can use it with toggleClass http://jsfiddle.net/mwpk61g8/

I want to be able to do:

$("#message").toggleClass("filled");

but since I'm using only javascript, the class in CSS doesn't exist. I end up repeating style attributes:

$("#message2").css({"color":"white", "background-color": "gray"});

Is there some way to do this? Or will I have to use: https://developer.mozilla.org/en-US/docs/Using_the_Stylesheet_Service ?

Author
Account Strength
100%
Account Age
12 years
Verified Email
Yes
Verified Flair
No
Total Karma
68,861
Link Karma
3,131
Comment Karma
65,422
Profile updated: 8 hours ago
Posts updated: 1 month ago

Subreddit

Post Details

We try to extract some basic information from the post title. This is not always successful or accurate, please use your best judgement and compare these values to the post title and body for confirmation.
Posted
9 years ago