title: passing the value from a textbox to another function
body: <p>I have an html textbox and get the value from it with the following code:</p>
  
  <pre><code>$('#getTextBoxValue').on("click", function(){
  var value = $("#textbox1").val();
  });
  </code></pre>
  
  <p>I then attempted to pass that value to a different function </p>
  
  <pre><code>function loadPdf(pdfPath) {
      var pdf = PDFJS.getDocument(pdfPath);
      return pdf.then(renderPdf);
  }
  
  loadPdf(value);
  </code></pre>
  
  <p>But the value isn't being passed. I then attempted to do the following:</p>
  
  <pre><code>$('#getTextBoxValue').on("click", 
      function(){
        var value = $("#textbox1").val();
        alert('The Value in Textbox is '+value);
  });
  </code></pre>
  
  <p>to see if the value was displayed, but that didn't work either (didn't get any output)</p>
  
  <p>EDIT: I do get an error in the console:</p>
  
  <pre><code>ReferenceError: $ is not defined
  </code></pre>
  
  <p>And if I remove the $ it says <code>('#getTextBoxValue).on is not a function</code></p>