how to send data to client side with ejs syntax code example
Example 1: how to use ejs with client side ejs
<div id="output"></div>
<script src="ejs.min.js"></script>
<script>
let people = ['geddy', 'neil', 'alex'],
html = ejs.render('<%= people.join(", "); %>', {people: people});
$('#output').html(html);
document.getElementById('output').innerHTML = html;
</script>
Example 2: using server passed values and client js together in ejs
<% var test = 101; %>
<script>
var getTest = <%= test %>;
console.log(getTest);
</script>