ad

Friday, October 3, 2025

how to use the html button tag with Example

 

how to use the  html button tag with Example

https://webdesigningtheory.blogspot.com

html button tag 

<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.

Button Tag Example:-

<!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 tag with Example

Explain 

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>

Displays heading titled on your page

Step 5]

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

type="button" :- specifies input button.

onclick ="alert('Hello World!')" :- JavaScript runs the button is clicked.

value="Click Me!"> :- label shows on the button

how to use the html button tag with Example

Button Tag output 

Button Tag output


Related Post :-

No comments:

Post a Comment