how to set value in global variable in jquery code example Example: jquery global variable window.varName