# How to retain variables from onLoad event?

**URL:** <https://forum.kirupa.com/t/how-to-retain-variables-from-onload-event/123697>\
**Category:** Uncategorized\
**Created:** [September 26, 2004, 10:37am UTC](https://forum.kirupa.com/t/how-to-retain-variables-from-onload-event/123697 "2004-09-26T10:37:40Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Carlos](https://avatars.discourse-cdn.com/v4/letter/c/ecae2f/32.png) [@Carlos](https://forum.kirupa.com/u/Carlos)\
**Post date:** [September 26, 2004, 10:37am UTC](https://forum.kirupa.com/t/how-to-retain-variables-from-onload-event/123697/1 "2004-09-26T10:37:40Z")

</div>

G’day,

Is it possible to retain variable information after exiting an onLoad event?

I have a variable declared outside the onLoad event which a function called from within the onLoad event populates. The problem is, after leaving the onLoad event the variable gets cleared. Any solutions?

Cheers,  
c
