From the course: jQuery for Web Designers

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

Use classes

Use classes - jQuery Tutorial

From the course: jQuery for Web Designers

Start my 1-month free trial

Use classes

- [Voiceover] In this video, we're going to talk about interacting with CSS classes in jQuery. While it is possible to manipulate styles directly from your JavaScript, usually, you're gonna wanna keep your styles defined with classes in your CSS files, and then use jQuery to manipulate those classes. We're gonna take a look at the methods that you can use to do that. So first, we're gonna take a look at a sort of fancy example here on Hansel and Petal, just to see a demonstration of how this works. And then, we're going to take a look at a simpler example and actually write a little code. So, what I'm interested in here, is the grid area in Build a Bouquet. If I click any of these flowers, you can see I get a check mark, and then the item is added to the cart. I'm not concerned so much for the cart right now, but this check mark business, this is all done with CSS, and to prove it, I'm going to right-click this and inspect it. So, as you can see, when I click this calla lily, if…

Contents