CSS
-Tricks
treehouse :
what would you like to learn today?
Web Design
Web Development
iOS Development
Show search box
Search
Search in:
All
Articles
Forums
Snippets
Videos
✕
Home
Forums
Snippets
Gallery
Videos
Almanac
Demos
Lodge
Navigation 'n' Search
Forums
Illustration by Nick Sirotich
Forums
»
JavaScript Jungle
:before css change with jQuery?
schart
Permalink to comment
#
March 2012
So I think it would be easier to understand if you just visit the jsfiddle link, but first, my goal is to be able to change the css of ".textarea:before" using jquery .click
http://jsfiddle.net/UQsKh/
TheDoc
Permalink to comment
#
March 2012
You can't directly target it with jQuery because it's technically not even a part of the DOM.
Some people have used jQuery to add classes and then have the CSS change based on those classes.
schart
Permalink to comment
#
March 2012
@TheDoc
- I understand, and I guess there are other ways to do this as well
schart
Permalink to comment
#
March 2012
This looks good, doesn't it? -
http://jsfiddle.net/UQsKh/1/
xpy
Permalink to comment
#
March 2012
@schart
this
looks better :P
schart
Permalink to comment
#
March 2012
@xpy
- Alot better, thank's :)
Add a Comment
http://jsfiddle.net/UQsKh/
Some people have used jQuery to add classes and then have the CSS change based on those classes.