title: How to define and call a function in ejs file using <% ... %> tags
body: <p>My ejs code:</p>
  
  <p>Getting error Uncaught ReferenceError: nextQuess is not defined at HTMLButtonElement.onclick</p>
  
  <pre><code>                    &lt;div&gt;
                        &lt;ol&gt;
                          &lt;% var setVar=0; var rowNo=0; %&gt;
                          &lt;% function nextQuess() { %&gt;
                            &lt;% console.log("inside nextQuess function"); %&gt;
  
                              &lt;%  } %&gt;
                          &lt;/ol&gt;
                      &lt;/div&gt;
                  &lt;div&gt;
                   &lt;button onClick="nextQuess()" id="next" &gt;Click me!&lt;/button&gt;
                  &lt;/div&gt;
  </code></pre>
  
  <p>What's wrong here. Thanks.</p>