I've already searched for different ways to do this but no luck with fixing my problem. My code looks basically like this:
<?php
$attnum = 1;
?>
<button type="button" onClick="<?php $attnum++ ?>">+</button>
<h3><em>att<?php echo "$attnum" ?>: </em></h3>
When the page loads it have already added 1 on $attnum. I only want to add on $attnum when the button is pressed. What have I done wrong?
Thanks
$attnum
or do you just want to start the javascript processing off at a specific number?