0
I need help
How do I make a button do something?
4 Answers
+ 1
<input type="button" value="Hi there" />
0
Is this button part of a form or a stand alone element? In the first case you may be thinking of the submit button of a form (check out the form sections of the SoloLearn course on HTML5). In the latter case just use a button tag (http://www.w3schools.com/tags/tag_button.asp) with a onclick element or other event attribute (e.g. <button type="button" onclick="alert ('hello')">Click me</button>).
0
I mean 'How do I make a button increase the value of a variable
0
Put the code to increase the variable as argument for the onclick attribute.
<button type="button" onclick="x=x+1;">increase variable x </button>