1. 41
    Adding Restaurant Information to our Popups
    30s

Adding Restaurant Information to our Popups

Colby Fayock
InstructorColby Fayock
Share this video with your friends

Social Share Links

Send Tweet

Now that we have our popups, we need to actually put some information in them!

Click here for exercise instructions

Instructor: [0:00] With each location, we want to show more than just its name. First, we need to destructure the rest of that information. When using setContent, we can actually set HTML. We're gonna start by creating a new constant called HTML. We're going to set it equal to a template literal tag, which we'll use for our HTML.

[0:13] Here, we're going to set a div to wrap it and we're setting our name inside of an H3 using a template variable. Now, if we change that content to that HTML, we can see each of our new popups which contains that H3.

[0:22] We can do something similar. I'm going to add this unordered list which has the rest of our information. Now, if we click the marker, we can see the names, some info, and its contact information.