<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>innerHTML</TITLE>
<META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>
<META content="MSHTML 5.00.2614.3500" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Hi all,</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>How can I dynamically create a new javascript 
variable that will be available to subsequent scripts.</FONT></DIV>
<DIV><FONT face=Arial size=2>I can use eval("var newvar;newvar=33;") to create 
the variable, but the new variable only seems to exist within the scope of the 
script block that it was created in. Below is a page that demonstrates what I 
mean... the first alert works, the second one says that newvar is 
undefined.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial 
size=2>&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;<BR>&lt;A HREF=# 
onclick='Javascript:eval("var newvar;newvar=33;");alert(newvar);'&gt;create 
variable "newvar"&lt;/A&gt;&lt;BR&gt;<BR>&lt;A HREF=# 
onclick='Javascript:alert("newvar="+newvar);'&gt;view&nbsp; 
"newvar"&lt;/A&gt;<BR>&lt;/body&gt;&lt;/html&gt;</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Thanks in advance</FONT></DIV>
<DIV><FONT face=Arial size=2>Lau</FONT></DIV></BODY></HTML>