Save this video free

Adding an HTML Template from JavaScript (10-26-2026) | CIS311

Kenan Casey · 32:02 · Watch on YouTube

Adding an HTML Template from JavaScript (10-26-2026) | CIS311 Watch on YouTube →

Overview

Kenan Casey demonstrates how to render recipe cards from a JavaScript array using an HTML <template>, vanilla JavaScript DOM methods, and a dedicated renderRecipes function. The workflow clones template.content, fills each card with recipe data, and appends the results to a grid, creating a structure that can later support filtering or data fetched from a server.

Key takeaways

Chapters

0:00 Building a Recipe Card with an HTML Template
6:55 Creating a Grid and a Reusable renderRecipes Function
11:30 Cloning Template Content and Appending Recipe Cards
18:45 Filling Recipe Details and Prep Time
22:10 Adding Recipe Images, Paths, and Alt Text
27:15 Styling the Grid and Extending Rendering to Search

Keep these chapters and the full searchable transcript in your own library.

Transcript excerpt

0:00 Today we're going to continue this amazing recipe app. You remember last time we worked it up and were able to load a set of an array hardcoded into our code of JavaScript objects onto our page. Today I'd like to improve this in a couple ways to make it more realistic to what you're going to need to do for the naturally ideal site. Okay. So going back to our code, you remember that we developed last time we hardcoded this array of objects and we wrote this little bit of JavaScript the load button that has a click event listener that replaces the text content of our output element and

0:49 then in the for loop it edits the text content. Um it actually here appends with a plus equals. So, it's adding more and more text to this. All right. So, we're going to improve this. Um, what I want us to do first here is go back to our HTML and we're going to do this, I think, the right way. So what we want to do is have an HTML template that we've defined in HTML. So that might include a lot of structure to have the kind of recipe card that I

1:36 want to have. So, like a, you know, you might have an image at the top and an H2 and then a little paragraph that explains it and then maybe a little thing underneath that says this is a 10-minute recipe and it's an easy. All right. So, then there's lots of styling that we can do to this that I'm not going to do, but the styling is just styling in CSS. Um, so at the bottom of my HTML, but above the script because I want the script tag to be at the very end. I want

This is the start of the transcript. Save this video free for the whole transcript, searchable and time-coded.

Related notes

Summary, takeaways, and chapters were generated by AI from the video's transcript and may contain errors. The video belongs to its creator, Kenan Casey.

Want the full transcript?

Save this video in YouTube Collector to get its complete searchable transcript, your own AI summaries, and a library that keeps every video you collect in one place.