Publish in HTML Tutorial el 23/05/2025 15:20
The <button> element creates a clickable button that can trigger actions on a webpage. Buttons can submit forms, trigger JavaScript functions, or perform other interactive tasks. Unlike <input type="button">, the <button> element can contain HTML content (text, images, etc.) and offers more styling flexibility.
Here are simple examples of how to use the <button> element:
A basic button with text content:
A button containing both text and an icon (using UTF8 Icons in this example):
A button that is disabled and cannot be clicked:
These examples demonstrate buttons that trigger JavaScript functions:
A button that shows an alert when clicked:
A button that modifies the page content when clicked:
Here are some important attributes for the <button> element:
type
attribute (button, submit, or reset)The <style> HTML element contains style information for a document, or part of a document. ...
The <strong> element is used to indicate that its content has strong importance, seriousnes...
The <span> element is an inline container used to mark up a part of a text or document. Unl...
The <source> element is used to specify multiple media resources for media elements like &l...
The <small> element is used to represent side-comments and small print, typically for discl...
HTML <section> Element: The Complete Guide The <section> element is a semantic HTML ...