Header Ads

HTML Input Button Tag Tutorial Syntax, Example

How to Use the HTML Button Input

How to Use the HTML Button Input




What is the Buttons input type HTML

 ✷ The button input type in HTML is used to create a clickable button on a web page. It is written using the <input> tag with the type attribute set to button. 
 ✷This type of button does not perform any action by default, but it can be programmed using JavaScript to perform tasks like showing messages, submitting data, or triggering events.

Syntax :-

  <input type="button"> 

✷ Buttons are created as the final component of any form. A button lets the user trigger son events like submission of data, upload/download or any kind of alert/message.


How to Use the HTML Button Input

 Output


<!DOCTYPE html>

<html>

<body>

<h2>Input Button</h2>

<input type="button" onclick="alert('Hello World!')"value="Click Me!">

 </body>

</html>

How to Use the HTML Button Input
Explain Program

Step 1 ]

<!Doctype html>

  • <!doctype html>  always be the first line of any HTML document.

Step 2 ]

   <html> and </html>

   html  is the root element.

Step 3 ]

<body> and </body>

body  is  main content area.

All visible content inside to  the <body> tag

Step 4]

<h2>Input Button</h2>

heading   type  Input Button

Step 5]

<input type="button" onclick="alert('Hello World!')"value="Click Me!">

1)  type ="button" - <button> tag html use creating interactive web page.
2)  onclick="alert('Hello World!')" - JavaScript onclick  web page
                      onclick buttton use -   web page are static page

How to Use the HTML Button Input

Button Tag output 


Button Tag output
Related Post :-

No comments

Powered by Blogger.