The button element has the same function as an input element but it has richer rendering possibilities, not only visually but it also may contain some content between opening and closing tags.

Syntax:

<button type="" name=""></button>

Attributes:

Example

HTML button element:

x
 
<html>
<head>
<title>HTML tutorial</title>
<style type="text/css">
button {
    height:40px;
    max-width:90px;
    font-size:0.8em;
    color:#fff;
    background:URL('../../../img/tutorials/butimg_ex1.png') no-repeat center center;
    border:0px;
    cursor:pointer;
}
</style>
</head> 
<body>
<br />
<form action="" method="post" name="form">
<input type="text" name="text" value="your name" /><br /><br />
<button name="submit" value="submit" type="submit">submit button</button>
</form>
 
<h6>p.s. submitting the form will not generate any action</h6>
</body>
</html>

 

›› go to examples ››