title: JQuery change variable value outside the function
body: <p>I want to change the value of my "clients" variable from outside the function, with the one from inside the function(which changes when I select something), and I dont know how to do that. Please help</p>
  
  <p>This is my code code </p>
  
  <pre><code>&lt;script&gt;
      var clients;
      $('#clients').on('change',function(e)
      {
          console.log(e);
  
          var clients = e.target.value;
  
      });
      document.write(clients);
   &lt;/script&gt;
  </code></pre>