title: how to show/hide a pre tag on button click by setting a variable in pug template
body: <p>I'm using pug for the first time and am stuck on setting a local variable to display a div only once a button is clicked. this is what I tried:</p>
  
  <pre><code>extends layout
  
  block content
    script.
      var something = function () {
        var display = true;
        console.log('hi', display);
      }
    button(href='#', type='button', onclick='something()') Get News Articles
    if display === true
      div.pre-space 
        pre
          code #{jsonArticles}
  </code></pre>
  
  <p>what am I doing incorrectly?        </p>