title: How to effectively use onClick and EJS
body: <p>I am trying to display a modal window based on an onClick event </p>
  
  <p>this is where i'm doing the onClick
  <div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div class = "post-content"&gt;
    &lt;a onClick = "&lt;%"show()"%&gt;"&gt; &lt;h6&gt;&lt;center&gt; &lt;%= imageData[0].title%&gt;&lt;/center&gt; &lt;/h6&gt; &lt;/a&gt;
    &lt;img src = "&lt;%= imageData[o].associated_images[0].url%&gt;"&gt;
    &lt;center&gt; &lt;%= imageData[0].short_description%&gt; &lt;/center&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>This is the modal window</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;% if(number){%&gt;
    &lt;div class = "single-preview"&gt;
      &lt;h6&gt;&lt;center&gt; &lt;%= imageData[0].title%&gt;&lt;/center&gt; &lt;/h6&gt; 
        &lt;center&gt;&lt;img src="&lt;%=imageData[0].associated_images[0].url%&gt;"style="width:720px height:405px;"&gt; &lt;/center&gt;
        &lt;center&gt; &lt;%= imageData[0].long_description%&gt; &lt;/center&gt;
        &lt;button class = "close-button"&gt; &amp;#215; &lt;/button&gt;
    &lt;/div&gt;
  &lt;%}%&gt;</code></pre>
  </div>
  </div>
  
  And this is my js file</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>router.get(name, function(req, res) {
    res.render('shows', {
      number: false
    });
  });</code></pre>
  </div>
  </div>
  </p>
  
  <p>Basically I'm trying to change the value of the variable <code>number</code> when <code>show()</code> is called.   </p>
  
  <p><strong>What I've tried</strong><br>
  a. putting the show function in the serverside<br>
  b. putting the show function in the client side<br>
  c. the many different way to use onclick that I've seen here<br>
  d. declaring the number variable in client side <code>&lt;% var number = false%&gt;</code>  </p>
  
  <p>Nothing is working for me. Please does anyone have any ideas</p>