Alert icon
We're changing our privacy policy. This stuff matters.  Learn more  Dismiss

Adding and Removing CSS Classes With jQuery - jQuery Tutorials for Beginners

Loading...

Sign in or sign up now!
Alert icon
Upgrade to the latest Flash Player for improved playback performance. Upgrade now or more info.
1,177
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Jun 28, 2011

Source code here: http://jquerytutorialsforbeginners.com/5 ... video highlights below.

[0:47] The setup
[1:24] The directory structure we're using
[2:00] Going through our starting source code
[3:47] What comes first, .css files or .js files?
[4:19] Writing our CSS code (simple p.highlight class)
[5:30] On click, add the highlight class to every paragraph on the page
[6:15] Highlighting only the second paragraph on the page (with some trial and error)
[7:48] Adding multiple classes with one click
[8:36] Using jQuery's .css method to achieve the same effect
[10:58] On click, remove the highlight class
[11:49] On click, toggle the highlight class
[12:33] Simple examples, lots of potential

Category:

Education

Tags:

License:

Standard YouTube License

  • likes, 0 dislikes

Link to this comment:

Share to:
see all

All Comments (1)

Sign In or Sign Up now to post a comment!
Loading...

Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more