How do I pre fill data in ejs?

Ok, so to use ejs in the browser you need to compile the template from a string, and then call that function with the data. Here’s a complete working example you should be able to follow to see how it hangs together.

<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title></title>
</head>
<body>
  <script type="text/javascript" src="https://github.com/mde/ejs/releases/download/v2.3.4/ejs.js"></script>
  <div id="wrapper"></div>
  <script type="text/ejs" id="template">
  <select class="form-control" id="clientName" required>
    <option></option>
      <% people.forEach(function (person) { %>
      <option value="<%= person.id %>"> <%= person.first_name %> <%= person.last_name %>
      <% }) %>
    </option>
  </select>
  </script>
  <script>
  var people = [{ id: 1, first_name: "Marilyn", last_name: "Munroe" }]
  var templateString = document.getElementById('template').innerHTML
  var template = ejs.compile(templateString)
  var html = template({ people: people })
  document.getElementById('wrapper').innerHTML = html;
  </script>
</body>
</html>