Using button as a Generic Element - HTML CSS HTML Tag

HTML CSS examples for HTML Tag:button

Introduction

If you set the type attribute to button, you create a button element.

It has no special meaning and won't do anything when you press it.

The following code shows the addition of such a button to the example HTML document.

Using a Generic Button

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
   <head> 
      <title>Example</title> 
   </head> 
   <body> 
      <form method="post" action="http://example.com/form"> 
         <p> 
            <label for="fave">
               Fruit: <!-- ww w .  ja va 2 s .c  o m-->
               <input autofocus id="fave" name="fave">
            </label> 
         </p> 
         <p> 
            <label for="name">
               Name: 
               <input id="name" name="name">
            </label> 
         </p> 
         <button type="submit">Submit Vote</button> 
         <button type="reset">Reset</button> 
         <button type="button">
            Do 
            <strong>NOT</strong>
             press this button
         </button> 
      </form>  
   </body>
</html>

Related Tutorials