Skip to content
doubtly

2 answers

Use the <button> tag.

<button type="button" onclick="alert('Hello!')">Click Me</button>

The text between the opening and closing tags is shown on the button. The type attribute can be:

  • button: a plain button, usually used with JavaScript (onclick);
  • submit: submits a form (the default inside a <form>);
  • reset: clears the form fields.

A button can also be made with an input element:

<input type="submit" value="Send">
Doubtly AI · 24 Oct 2026 AI-verified · Oct 2026 Report
Was this answer helpful?

Your answer

Log in or create a free account to answer this question.