Interactive online courses HTML Academy
2026-03-09 12:25 Diff

Now that we have a special function, we can replace all lines of code with element creation, addition of a class and text content with one line with makeElement call. It’ill make the code more readable and convenient.

Please note that when creating a product card with makeElement, we transfer only the li tag and product class to the function. The card does not have any text content, only its child elements have it (product names and prices). Here’s the case for which we wrote a check in the function!