[Javascript] global variables thru OnClick event

Muchacho, Laurent (TWIi London) LMuchacho at twii.net
Thu Sep 5 04:18:52 CDT 2002


Hi 

You not making any effort really 
if you declare you variable when you do the onclick you will not be able to
access it because the document is already loaded and no variable as been
declared.
 
try to declare you variable in the head of your document 
<head>
<script language="javascript">
var test = 0;
</script>
</head>

and on your onclick 

something like that 

 (Onclick="test=12").

Laurent 


-----Original Message-----
From: Iztok Polanic [mailto:iztokp at amis.net]
Sent: 05 September 2002 10:04
To: javascript at LaTech.edu
Subject: [Javascript] global variables thru OnClick event


Hi!

I'm setting some variables thru OnClick event (Onclick="var test=12"). But I
can't access this variable. So how can I set global variables thru Onclik
event?

Bye

Iztok

_______________________________________________
Javascript mailing list
Javascript at LaTech.edu
https://lists.LaTech.edu/mailman/listinfo/javascript


DISCLAIMER - The preceding e-mail message (including any attachments)
contains information that may be confidential, may be protected by the
attorney-client or other applicable privileges, or may constitute non-public
information.  It is intended to be conveyed only to the designated
recipient(s) named above.  If you are not an intended recipient of this
message, or have otherwise received it in error, please notify the sender by
replying to this message and then delete all copies of it from your computer
system.  Any use, dissemination, distribution, or reproduction of this
message by unintended recipients is not authorized and may be unlawful. The
contents of this communication do not necessarily represent the views of
this company.



More information about the Javascript mailing list