how to declare a global variable inside a function in jquery code example Example: jquery global variable window.varName