title: Load javascript file after button click
body: <p>I am trying to use a set of textboxes to define some data within my JavaScript file. So in a textbox I enter a Team name "Team name", and the javascript file uses this textbox to store the name of a team in order to print a set of tournament brackets.</p>
  
  <p>The javascript file is included in my <code>&lt;head&gt;</code>  so it loads before I have actually entered the data in the text boxes. I have this code for a button in the html like so:</p>
  
  <pre><code>script(type='text/javascript')
      $('#buttontest').click(function() {
          $('div.bracket').show();
          $('div.teamList').hide();
      });
  </code></pre>
  
  <p>So when the button is pressed, the textboxes are all hidden, and the brackets with the user-defined team names should appear....here is the code at the end of my javascript file:</p>
  
  <pre><code>$(function() {
      $('#singleElim8').bracket({
          init: singleElim8Data
      })
    $('.bracket').hide();
  });
  </code></pre>
  
  <p>So within div.bracket I have the class #singleElim8 which the javascript uses. But how would I change it so that this javascript to initialize the brackets only runs once the button has been clicked? That way the brackets render AFTER the textboxes have been filled in. Any help appreciated.</p>