Javascript examples for Data Type:Variable Scope
Change a global variable from within a function
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> var winversion;//from w ww . ja v a 2 s . c om function setwinver(ver) { console.log(ver); winversion = ver; } </script> </head> <body> <h1>Index page</h1> </body> </html>