How to use the html button tag
This Blog You Will Learn
ஃ What is the <button> tag in HTML?
ஃ Syntax of HTML <dialog> tag
ஃ Why USe the <button> tag ?
ஃ Important Attributes <button>
ஃ Type of <button> tag in HTML
ஃ how to use the html button tag Example
ஃ Explain Program
ஃ how to use the html button tag Output
What is the <button> tag in HTML?
✅The <buttons> tag are one of the most important elements on website.
✅HTML <button> tag used create clickable buttons than perform actions such as submitting forms.
✅ HTML <button> tag is use to create a clickable button that can submit forms, reset data or trigger actions.
Syntax of HTML <dialog> tag
<button type="button"> Button text </button>
Why USe the <button> tag ?
✔ Creates interactive elements.
✔ Is accessible by keyboard and screen readers.
✔ Works with forms and Javascript.
✔ Can contain text, icons and HTML.
Type of <button> tag in HTML
1) Submit Button (type= "submit ")
- submit form data to server.
- button acts submit button by default.
2) Reset Button (type= "reset")
- Resets all form fields to default values .
- reset buttons carefully as they can erase user input.
3) Normal Button (type="button")
- perform custom actions usually with javascript
1) type
- Disables the button.
3) name and value
- use to send button data during form submission
4) autofocus
- automatically focuses the button when page loads.
how to use the html button tag
Example
how to use the html button tag
Explain Program
Step 1]
<!DOCTYPE html>
- This declare the document type.
- browser that the document is written in html
Step 2 ]
<html>.... . </html>
- html is the root element of the html page.
- Every thing inside it is part of the webpage.
Step 3]
- <head> section
- head section contains metadata about page. not visible on the page itself.
- <title> tag title section set the title of the page shows the browser tab.
Step 4]
- HTML <body> tag contains all appear on webpage.
- HTML <h1> tag heading tag.
- HTML <button> :- create button on webpage.
- <type=" button"> :- browser this clickable button
- </button> :- ends the button.
how to use the html button tag
Output
Related Post :-
how to set image height
html link tag explain
how to use pre tag
