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 ?
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
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/jquery/comm...