how to make a global javascript variable in function code example
Example: create global variable inside function JavaScript
<script>
function foo() {
window.yourGlobalVariable = ...;
}
</script>
<script>
function foo() {
window.yourGlobalVariable = ...;
}
</script>