HTML
Có thể bạn quan tâm
- Courses
- DSA to Development
- Machine Learning & Data Science
- Generative AI & ChatGPT
- Become AWS Certified
- DSA Courses
- Data Structure & Algorithm(C++/JAVA)
- Data Structure & Algorithm(Python)
- Data Structure & Algorithm(JavaScript)
- Programming Languages
- CPP
- Java
- Python
- JavaScript
- C
- Tutorials
- Python Tutorial
- Taking Input in Python
- Python Operators
- Python Data Types
- Python Numbers
- Python String
- Python Lists
- Python Tuples
- Sets in Python
- Python Dictionary
- Python Loops and Control Flow
- Python Conditional Statements
- Python Loops
- Python Functions
- Python OOPS Concept
- Python Data Structures
- Python DSA
- Linked List
- Stack
- Queue
- Tree
- Heap
- Hashing
- Graph
- Sets
- Map
- Advance Data Structure
- Sorting Algorithms
- Searching Algorithms
- Python Exception Handling
- Python File Handling
- Python Exercises
- Python List Exercise
- Python String Exercise
- Python Tuple Exercise
- Python Dictionary Exercise
- Python Set Exercise
- Python Design Patterns
- Python Programming Examples
- Python Practice Questions
- Java
- Java Programming Language
- Java Tutorial
- Data Types
- Variables
- Operators
- Flow Control in Java
- Loops in Java
- Methods
- Strings
- Arrays
- OOPs Concepts
- OOPs Concepts
- Classes and Objects
- Access Modifiers
- Inheritance
- Abstraction
- Encapsulation
- Polymorphism
- Interface
- Packages
- Multithreading
- File Handling
- Regular Expression
- Java Collections
- Java Collections
- Collection Class
- List Interface
- ArrayList
- LinkedList Class
- Queue Interface
- Set Interface
- HashSet Class
- Map Interface
- HashMap Class
- HashTable Class
- Iterator
- Comparator
- Collection Interview Questions
- Java 8 Tutorial
- Java Programs
- Java Programming Examples
- Java Array Programs
- Java String Programs
- Java Date-Time Programs
- Java File Handling Programs
- Java Collection Programs
- Java JDBC Programs
- Java Apache POI Programs
- Java OpenCV Programs
- Java Interview Questions
- Java Interview Questions
- Core Java Interview Questions-Freshers
- Java Multithreading Interview Questions
- OOPs Interview Questions and Answers
- Java Exercises
- Java Quiz
- Java Quiz
- Core Java MCQ
- Java Projects
- Advance Java
- Spring Tutorial
- Spring Boot Tutorial
- Spring Boot Interview Questions
- Spring MVC Tutorial
- Spring MVC Interview Questions
- Hibernate Tutorial
- Hibernate Interview Questions
- Java Programming Language
- Programming Languages
- C
- C++
- JavaScript
- PHP
- R Tutorial
- C#
- SQL
- Scala
- Perl
- Go Language
- Kotlin
- System Design
- System Design Tutorial
- What is System Design
- Key Terminologies in System Design
- Analysis and Architecture of Systems
- Scalability in System Design
- Databases in System Design
- High Level Design or HLD
- Low Level Design or LLD
- Case Studies in Designing Systems
- Complete System Design Tutorial
- Software Design Patterns
- System Design Roadmap
- Top 10 System Design Interview Questions and Answers
- System Design Tutorial
- Interview Corner
- Company Preparation
- Top Topics
- Practice Company Questions
- Interview Experiences
- Experienced Interviews
- Internship Interviews
- Competitive Programming
- Multiple Choice Quizzes
- Aptitude for Placements
- Computer Science Subjects
- Operating System
- DBMS
- Computer Networks
- Engineering Mathematics
- Computer Organization and Architecture
- Theory of Computation
- Compiler Design
- Digital Logic
- Software Engineering
- DevOps
- GIT
- AWS
- Docker
- Kubernetes
- Microsoft Azure Tutorial
- Google Cloud Platform
- Linux
- Linux Tutorial
- Linux Commands A-Z
- Linux Commands Cheatsheet
- File Permission Commands
- Linux System Administration
- Linux File System
- Linux Shell Scripting
- Linux Networking
- Linux Interview Questions
- Software Testing
- Software Testing Tutorial
- Software Engineering Tutorial
- Testing Interview Questions
- Jira
- Databases
- DBMS Tutorial
- SQL Tutorial
- PostgreSQL Tutorial
- MongoDB Tutorial
- SQL Interview Questions
- MySQL Interview Questions
- PL/SQL Interview Questions
- Android
- Android Tutorial
- Android Studio Tutorial
- Kotlin For Android
- Android Projects
- Android Interview Questions
- 6 Weeks of Android App Development
- Excel
- MS Excel Tutorial
- Introduction to MS Excel
- Data Analysis in Excel
- Basic Excel Formulas & Functions
- Data Analysis in Advanced Excel
- Workbooks
- Statistical Functions
- Data Visualization in Excel
- Pivot Tables in Excel
- Excel Spreadsheets in Python
- Basic Excel Shortcuts
- Mathematics
- Number System
- Algebra
- Linear Algebra
- Trigonometry
- Set Theory
- Statistics
- Probability
- Geometry
- Mensuration
- Logarithms
- Calculus
- Python Tutorial
- DSA
- Data Structures
- Arrays
- Matrix
- Strings
- Linked List
- Singly Linked List
- Doubly Linked List
- Circular Linked List
- Doubly Circular Linked List
- Linked List Tutorial
- Stack
- Queue
- Tree
- Generic Tree
- Binary Tree
- Binary Search Tree
- AVL Tree
- B Tree
- B+ Tree
- Red Black Tree
- Tree Data Structure Tutorial
- Heap
- Hashing
- Graph
- Set Data Structure
- Map Data Structure
- Advanced Data Structure
- Data Structures Tutorial
- Algorithms
- Analysis of Algorithms
- Design and Analysis of Algorithms
- Asymptotic Analysis
- Asymptotic Notations
- Worst, Average and Best Cases
- Searching Algorithms
- Linear Search
- Binary Search
- Searching Algorithms Tutorial
- Sorting Algorithms
- Selection Sort
- Bubble Sort
- Insertion Sort
- Merge Sort
- Quick Sort
- Heap Sort
- Counting Sort
- Radix Sort
- Bucket Sort
- Sorting Algorithms Tutorial
- Greedy Algorithms
- Dynamic Programming
- Graph Algorithms
- Pattern Searching
- Recursion
- Backtracking
- Divide and Conquer
- Mathematical Algorithms
- Geometric Algorithms
- Bitwise Algorithms
- Randomized Algorithms
- Branch and Bound
- Algorithms Tutorial
- Analysis of Algorithms
- DSA Tutorial
- Practice
- All DSA Problems
- Problem of the Day
- Company Wise Coding Practice
- Amazon
- Microsoft
- Flipkart
- Explore All
- GfG SDE Sheet
- Practice Problems Difficulty Wise
- School
- Basic
- Easy
- Medium
- Hard
- Language Wise Coding Practice
- CPP
- Java
- Python
- Curated DSA Lists
- Beginner's DSA Sheet
- Top 50 Array Problems
- Top 50 String Problems
- Top 50 DP Problems
- Top 50 Graph Problems
- Top 50 Tree Problems
- Competitive Programming
- Company Wise SDE Sheets
- Facebook SDE Sheet
- Amazon SDE Sheet
- Apple SDE Sheet
- Netflix SDE Sheet
- Google SDE Sheet
- DSA Cheat Sheets
- SDE Sheet
- DSA Sheet for Beginners
- FAANG Coding Sheet
- Product-Based Coding Sheet
- Company-Wise Preparation Sheet
- Top Interview Questions
- Puzzles
- All Puzzles
- Top 100 Puzzles Asked In Interviews
- Top 20 Puzzles Commonly Asked During SDE Interviews
- Data Structures
- Data Science
- Python Tutorial
- R Tutorial
- Machine Learning
- Data Science using Python
- Data Science using R
- Data Science Packages
- Pandas Tutorial
- NumPy Tutorial
- Data Visualization
- Python Data Visualization Tutorial
- Data Visualization with R
- Data Analysis
- Data Analysis with Python
- Data Analysis with R
- Deep Learning
- NLP Tutorial
- Web Tech
- HTML Tutorial
- CSS Tutorial
- JavaScript Tutorial
- PHP Tutorial
- ReactJS Tutorial
- NodeJS Tutorial
- AngularJS Tutorial
- Bootstrap Tutorial
- Typescript
- Web Development Using Python
- Django
- Django Tutorial
- Django Projects
- Django Interview Questions
- Flask
- Flask Tutorial
- Flask Projects
- Flask Interview Questions
- Postman
- Github
- Django
- Wordpress Tutorial
- Web Design
- Cheat Sheets
- HTML Cheat Sheet
- CSS Cheat Sheet
- JavaScript Cheat Sheet
- React Cheat Sheet
- Angular Cheat Sheet
- jQuery Cheat Sheet
- Bootstrap Cheat Sheet
- Learn Complete Web Development
- HTML Tutorial
- HTML Exercises
- HTML Tags
- HTML Attributes
- Global Attributes
- Event Attributes
- HTML Interview Questions
- HTML DOM
- DOM Audio/Video
- HTML 5
- HTML Examples
- Color Picker
- A to Z Guide
- HTML Formatter
The <button> tag in HTML is used to create clickable buttons on a web page. It can be used to submit forms, trigger JavaScript functions, or perform other interactive tasks.
HTML <!DOCTYPE html> <html> <body> <button type="button" onclick="alert('Welcome to GeeksforGeeks')"> Click Here </button> </body> </html>Note:
- It is important to specify the type attribute for a button element to inform the browser of the button’s function.
- The HTML <button> tag supports the Global Attribute and Event Attribute in HTML.
Attributes:
The various attributes that can be used with the “button” tag are listed below:
Attributes | Descriptions |
---|---|
autofocus | Sspecifies whether the button should automatically get focus or not when the page loads |
disabled | indicate whether the element is disabled or not. If this attribute is set, the element is disabled. |
form | Create a form for user input. There are many elements that> are used within the >form tag. |
formaction | Sspecifies where to send the data of the form. |
formnovalidate | Sspecifies that the Input Element should not be validated when submitting the form. |
formenctype | Sspecifies that the form data should be encoded when submitted to the server. |
formmethod | Sspecifies the HTTP method used to send data while submitting the form. |
formtarget | Sspecifies the name or a keyword that indicates where to display the response after submitting the form. |
type | Sspecifies the type of button for button elements. It is also used in <input> element to Sspecifies the type of input to display. |
value | Sspecifies the value of the element with which it is used. It has different meanings for different HTML elements. |
Button with custom CSS
HTML <!DOCTYPE html> <html lang="en"> <head> <style> button{ padding:10px20px; font-size:16px; margin-top:40px; border:none; cursor:pointer; border-radius:4px; transition:background-color0.3sease; color:#fff; } </style> </head> <body> <button style="background-color: #3daaf3; ">Primary</button> <button style="background-color: #3bda7d; ">Secondary</button> <button style="background-color: #f08f3b; ">Warning</button> <button style="background-color: #e44331; ">Danger</button> </body> </html>HTML button Tag – FAQ’s
What are the different types of buttons available with the <button> tag?
The <button> tag supports three types via the type attribute: button, submit, and reset. By default, it’s type=”submit” if not specified.
What’s the difference between the <button> and <input type=”button”> tags?
The <button> tag is more flexible as it can contain HTML content (like images or text), while <input type=”button”> is limited to plain text.
How do you disable a button using the <button> tag?
You can disable a button by adding the disabled attribute: <button disabled>Disabled Button</button>. Disabled buttons are unclickable and appear grayed out.
Can the <button> tag contain other HTML elements?
Yes, the <button> tag can contain other elements like <span>, <img>, or even formatted text for more complex button designs.
How does the form attribute work with the <button> tag?
The form attribute links a button to a specific form by Sspecifiesing the form’s ID, allowing buttons to submit forms outside the form’s immediate scope.
S
sheyakhare1999 Follow Improve Previous Article HTML <br> Tag Next Article HTML <caption> TagSimilar Reads
button tag vs input type="button" attribute The <input type="button"> and <button> tag are two different approach to use Button in HTML document. The difference between them is that the buttons created with the <button> tag offer many contributing possibilities than <input type="button"> attribute. The <button> can have content inside it. The <button> tag 2 min read Which tag is used to represent progress of a task in HTML & how is it different from <meter> tag ? In this article, we will see which tag is used to represent the progress of a task in HTML. To represent the progress of a task, we will use the <progress> tag. This tag is used to represent the progress of a task. It is also defined how much work is done and how much is left. Syntax: <progress attributes...> </progress> Attribute 2 min read Is container tag same as the empty tag in HTML? If not, why ? In this article, we will see the container tag & empty tag in HTML, along with knowing how they're different from each other. The Container tag is not the same as the empty tag & these are two different categories of tags used in HTML. Container tag: This tag contains 3 parts, namely, the opening tag, content that will be displayed in the b 5 min read How to trigger HTML button after hitting enter button in textbox using JavaScript ? In this article, we are given an HTML document containing a text area and the task is to trigger the button when the user hit Enter button. We can do it by using the "keyup", "keydown", or "keypress" event listener on the textbox depending on the need. When this event is triggered, we check if the key pressed is ENTER or not. If the key pressed is 4 min read Why <big> tag is not in HTML5 while <small> tag exists ? The <big> tag was discontinued in HTML5 while <small> tag is still in handy because <small> tag is frequently used to represent small prints like footnotes, copyright notices, comments etc. Many alternatives for <big> tag are already available such as <h1>, <h2> and so on. In HTML5 instead of using <big>, y 2 min read Explain the difference between head Tag and header Tag in HTML5 ? The <head> element is a container for metadata and is placed between the <html> and <body> tags. The <header> is for the main content section's introductory elements, like headings or logos and it mainly focuses on what appears at the top of the webpage. <head> ElementThe <head> element is part of the HTML docume 1 min read What is the difference between the <br> Tag and the <p> Tag ? The <br> tag is used to insert a line break, creating a new line within text or content. It doesn't have a closing tag and is a self-closing tag. On the other hand, the <p> tag defines a paragraph, separating blocks of text. It has an opening <p> and a closing </p> tag, allowing for the structured organization of text into p 2 min read Difference between <article> tag and <section> tag Both the tags are semantics in HTML 5. In this article, we will discuss about the <article> and <section> tag. Both the <article> and <section> tags are represented similarly but used for some meaning, that meaning is for the browsers and the developers. Both tags can replace each other as there will be no changes to the out 4 min read What purpose does a <script> tag serve inside of a <noscript> tag? Usage of NoScript tag: The tag defines alternate content that will be displayed if the user has disabled script or browser does not support script. It can be used inside both <head> and <body> tag. Syntax: <noscript> Contents... </noscript> Example: [GFGTABS] HTML <html> <head> <title>wbr Tag</title> 1 min read How to change the href value of a tag after click on button using JavaScript ? JavaScript is a high-level, interpreted, dynamically typed, and client-side scripting language. HTML is used to create static web pages. JavaScript enables interactive web pages when used along with HTML and CSS. Document Object Manipulation (DOM) is a programming interface for HTML and XML documents. DOM acts as an interface between JavaScript and 4 min read How to use Anchor tag as submit button ? The <a> (anchor tag) in HTML is used to create a hyperlink on the webpage. This hyperlink is used to link the webpage to other web pages. It’s either used to provide an absolute reference or a relative reference as its “href” value. Syntax: <a href = "link"> Link Name </a> The href attribute specifies the URL of the page the link 3 min read How to Hide Full Screen Button of the Video Tag in HTML5 ? The <video> element is used to embed video content on the web page. It allows the addition of video files in many formats such as MP4, WebM, etc. This element supports attributes like controls, autoplay, and loop to control video playback. It also enables the addition of captions and subtitles for accessibility. Preview: Approach:Create a str 1 min read How to create a radio button similar to toggle button using Bootstrap ? Toggle Buttons: The buttons that can change from one state to another, i.e. which can be toggled from on state to off state or vice-versa are called toggle buttons. For example: A particular switch in our house can either be on or off. This is a very good example of a real life toggle switch. The WiFi or Bluetooth option in our phone is another exa 3 min read How to set radio button checked by button click in AngularJS ? In this article, we will see how to set the radio button checked by button click in AngularJS, along with knowing its implementation through the examples. Approach: The approach is to use the ng-checked directive to check the radio button in the DOM. In the first example, a single radio button is checked by the button and In the second example, mul 2 min read Angular PrimeNG Button Properties of p-button Angular PrimeNG is an open-source framework with a rich set of native Angular UI components that are used for great styling and this framework is used to make responsive websites with very much ease. This article will show us how to style the Tooltip component in Angular PrimeNG. A Button is generally used for carrying out some action when clicked. 5 min read HTML <html> Tag HTML is a language full of diverse elements, and one such element is the <html> tag. This tag, standing for ‘HyperText Markup Language’, is used to define the root of an HTML or XHTML document. It serves as the main container for all other HTML elements, excluding the <!DOCTYPE> declaration. Understanding the <html> TagThe <htm 3 min read HTML | <noframes> Tag The <noframes> tag is the backup for those browsers that does not support frames. This tag can contains all the element that can be placed in <body> tag. It is used to create link with the non-frame set version of any website where you want to display a message to the user. This <noframes> tag is not supported in HTML5. Syntax: 1 min read HTML <hgroup> Tag The <hgroup> tag in HTML stands for heading group and is used to group the heading elements. The <hgroup> tag in HTML is used to wrap one or more heading elements from <h1> to <h6>, such as the headings and sub-headings. The <hgroup> tag requires the starting tag as well as ending tag. Note: <hgroup> is deprecate 1 min read HTML | <bgsound> tag The HTML <bgsound> tag is used to play the soundtrack in the background, when you leave the page behind and open a new tab this tag will continuously play the track in the background. This tag is not for other browsers except the Internet Explorer. It does not display any graphical interface just played the track in the background. Syntax: 1 min read HTML | <isindex> tag The <isindex> tag is used to querying any document through a text field. Means this tag inform the browser that the user wants to provide the search function through the document. If you want to search any specific word in a long article this tag is helpful then. But during these days all the browsers contain that feature by pressing CTRL + F 2 min read Differences between HTML <center> Tag and CSS "text-align: center;" Property If you are designing a simple web page, then not much difference is noticeable, but it is very necessary to understand the basic differences between these two. Since we are only concerned with the text, these elements do not have separate meanings.HTML <center> tag: The <center> tag in HTML is used to set to align of text into the cente 3 min read How to validate HTML tag using Regular Expression Given string str, the task is to check whether it is a valid HTML tag or not by using Regular Expression.The valid HTML tag must satisfy the following conditions: It should start with an opening tag (<).It should be followed by a double quotes string or single quotes string.It should not allow one double quotes string, one single quotes string o 6 min read How to get all HTML content from DOMParser excluding the outer body tag ? DOM (Document Object Model) allows us to dynamically access and manipulate the HTML data. All the text data from an HTML file can also be extracted using DOMParser. DOM parser returns an HTML/XML/SVG object. All the objects can be accessed using the [ ] operator in javascript. The HTML DOM Tree of objects: Steps to get all the text from an HTML doc 2 min read HTML sup Tag The <sup> tag in HTML describes the text as a superscript text. Here the text is above the baseline of the text and that text appears in a smaller font. Syntax: <sup> Content... </sup> Example 1: C/C++ Code <!DOCTYPE html> <html> <head> <title>HTML sup Tag</title&g 1 min read How to draw a circle using SVG tag in HTML ? In this article, you will learn about SVG basic shape like circle which is among the different shapes of SVG like <rect>, <line>, <ellipse>, <polygon>, etc. So you can easily draw circles using <circle> tag whose parent tag is SVG tag in HTML. Basically, the <circle> element draws a circle on the screen which is 2 min read Explain the significance of <head> and <body> tag in HTML The HTML <head> and <body> tags are the two most commonly used tags in HTML. It is very rare to find an industry-level website that does not use the <head> and <body> tag in its pages. In this article, we are going to learn the significance of these two tags in an HTML document. Significance of HTML <head> tag: The hea 3 min read HTML <slot> Tag The slot is the element part of the web component technology which is a placeholder inside a component that you simply can fill together with your own markup, which allows you to make separate DOM trees and represent them together. Syntax: <slot> <h1>Heading</h1> </slot> Attributes: name: It describes the name of the slot. A 2 min read What is the use of <legend> tag in HTML ? In this article, we will discuss <legend> tag in HTML. The legend tag is used to define the title for the child's contents. The legend elements are the parent element. This tag is used to define the caption for the <fieldset> element. Syntax: <legend> Some Text...... </legend> Example 1: In this example, we are going to crea 1 min read Which specific tag is used to represent the article in HTML ? In this article, we will see how to represent the article in HTML. The <article> tag is one of the new sectioning element in HTML5. The HTML <article> tag is used to represent an article. More specifically, the content within the <article> tag is independent of the other content of the site (even though it can be related). In othe 2 min read Which tag is used to define the abbreviation of an element in HTML ? In this article, we will discuss the tag that is used to define an abbreviation. The <abbr> tag in HTML is used to define the abbreviation or the short form of an element. The <abbr> and <acronym> tags are used as shortened versions and used to represent a series of letters. The abbreviation is used to provide useful information t 1 min read Article Tags :- HTML
- Technical Scripter
- Web Technologies
- HTML-Tags
What kind of Experience do you want to share?
Interview Experiences Admission Experiences Career Journeys Work Experiences Campus Experiences Competitive Exam ExperiencesTừ khóa » Html Button Properties
-
Attributes
-
CSS Buttons - W3Schools
-
The Button Element - HTML: HyperText Markup Language | MDN
-
HTML Button Tag - Usage, Attributes, Examples | W3Docs
-
HTML Button Tag - Javatpoint
-
Learn Attributes Of HTML Button Tag - EduCBA
-
HTML Button Type – How To Add Buttons To Your Website
-
Creating A Button With The HTML Button Element: Here's How »
-
Button Type In HTML: Here's Why You Should Always Declare It »
-
HTML Button Tag - Types, Effects And Attributes - DataFlair
-
Learn HTML Buttons In 5 Minutes 🛎️ - YouTube
-
Ion-button: Design And Style Buttons With Custom CSS Properties
-
HTML | DOM Button Value Property - GeeksforGeeks
-
HTML Button Style Attribute - Dofactory