0

For example, if I have a file called functions.ejs with this method in it -

<%
myFunction = (msg) => { %>
    <h1> <%= msg %> </h1> 
<% } %>

This method returns nothing when called, with or without using 'return'. Of course you can return html as a string but is there a way to return html like this with EJS? I know this method works in PHP.

If this is impossible, can anyone explain why and if there are other ways to do this in javascript?

Hizzie
  • 11
  • 2
  • I'm not too familiar with EJS but maybe this helps? https://stackoverflow.com/questions/10326950/render-a-variable-as-html-in-ejs – TCooper Oct 14 '20 at 21:26
  • Sorry TCooper, that isn't what I'm looking for. I understand how the EJS tags work. – Hizzie Oct 14 '20 at 21:56

0 Answers0