Skip to content

Reading 11

Avrey125 edited this page Sep 23, 2019 · 1 revision

EJS: templating language that lets you generate HTML markup with plain JavaScript

<%= tagline %> : syntax for using ejs to manipulate/create html

You can also write js into your html, ex, a foreach loop:

Loop

    <% drinks.forEach(function(drink) { %>
  • <%= drink.name %> - <%= drink.drunkness %>
  • <% }); %>
...

ejs is often spread out across multiple ejs files when creating html, head.ejs, header.ejs, and footer.ejs are some examples, these are called partials

Clone this wiki locally