HTML Buttons
HTML Buttons
HTML buttons allow users to interact with a webpage, such as submitting forms, triggering scripts, or performing actions. The <button> tag is commonly used, and it can contain text or HTML content like images.
Basic Button Example
Output:
A simple clickable button that says Click Me.
Button Types
-
Submit Button – Submits a form.
-
Reset Button – Resets form fields.
-
Regular Button – Can be used with JavaScript.
Styled Button Example
Output:
A blue button with white text, padding, and rounded corners.
Key Points
-
<button>can contain text, images, or HTML elements. -
Use type=”submit”, type=”reset”, or type=”button” depending on functionality.
-
Buttons can be styled using CSS for better appearance.
