- In HTML <button> tag is used to clickable button within form on your webpage.
- We can put content like image or text within the <button>to</button> tag.
- For <button> tag we should always specify the type attribute.
- The button element is used for various browsers using different default type.
- Button tag can be used inside and outside the form in HTML.
- It works as the submit button and also reset button, while if we use it inside the form.
- It can call JS on it, while if weuse it outside the form.
Sample Code
[pastacode lang=”markup” manual=”%3C!DOCTYPE%20html%3E%0A%3Chtml%3E%0A%3Cbody%3E%0A%0A%3Ch1%3EWelcome%20to%20Wikitechy%3C%2Fh1%3E%0A%0A%3Cbutton%20type%3D%22button%22%20onclick%3D%22alert(‘Hello%20world!’)%22%3EClick%20Me!%3C%2Fbutton%3E%0A%20%0A%3C%2Fbody%3E%0A%3C%2Fhtml%3E%0A%0A” message=”” highlight=”” provider=”manual”/]Output

