change value of a variable

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi to all,

I have this javascript code inside my aspx page, but i would like to change
the value of the variable lunch depending if i click a button in my form. i
dont know if its possible.

Here is the code:

<head>
<script language="javascript">
var lunch=2;
</script>
</head>
 
Josema,

In the onclick handler for your javascript, all you should have to do is
"lunch = 4;" or whatever you want to set it to. For example:

<input type="button" onclick="lunch=4;">

Hope this helps.
 
Back
Top