Which is the right way of declaring a global javascript variable? The way I\'m trying it, doesn\'t work
$(document).ready(function() {
var intro;
i
Unlike another programming languages, any variable declared outside any function automatically becomes global,
You problem is that you declare variable inside ready() function, which means that it becomes visible (in scope) ONLY inside ready() function, but not outside,
Solution:
So just make it global, i.e declare this one outside $(document).ready(function(){});