jQuery global variable, not working - Javascript jQuery

Javascript examples for jQuery:Variable

Description

jQuery global variable, not working

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <script type="text/javascript">
    window.onload=function(){/*from   ww w  . j a  v a2 s  .com*/
var test_1 = "None";
$(function(){
    console.log(test_1)
})
    }

      </script> 
   </head> 
   <body>   
      <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>      
   </body>
</html>

Related Tutorials