From the course: jQuery Essential Training

Unlock the full course today

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

Solution

Solution - jQuery Tutorial

From the course: jQuery Essential Training

Start my 1-month free trial

Solution

- [Narrator] How did you do? Did you get it to work? Let's take a look at how I solved this particular challenge. Now one of the things I want to point out here is that it's not important that you got the same answer that I did, because there's many ways you can solve problems like this using jQuery. I'm just going to show you how I chose to solve the problem, and your solution may have been a little bit different. Go ahead and open the finished version of the index.html page and we're gonna go through my code. Right here at the top I started off by including the jQuery library. Now I didn't do that in the start version so hopefully you didn't stumble over that too much. Then I have three lines of jQuery code that dynamically change the background of each of the product names. Before we go through that if you scroll down to the product section, and remember that each one of the product names was inside a heading two tag with a CSS class that has product-name on it, and each of these…

Contents