title: update the global variable in jquery
body: <p>How can I update the variable value in jQuery? How can I update the variable value as it updates in functions? I checked the scope of variable in jQuery but I did not understand.</p>
  
  <pre><code>&lt;script&gt;
  $(document).ready(function(){
    var s = 9;
    function data()
    {
       var s = 11;
    }
    data();
    alert(s);
  });
  &lt;/script&gt;
  </code></pre>
  
  <p>I want 11 in alert for data but I am getting 9. how can I update the value if its updated in functions. please help me out for this.</p>