SyntaxFix
Write A Post
Hire A Developer
Questions
yes, supposing your variable is in the global namespace:
<button onclick="myVar += 1;alert('myVar now equals ' + myVar)">Increment!!</button>