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:
- id, class (document-wide identifiers)
- lang (language information), dir (text direction)
- title (element title)
- style (inline style information)
- name (elements name)
- type (input element control type)
- value (initial and sent to server values)
- disabled (disabled input controls)
- tabindex (tabbing navigation)
- accesskey (access keys)
- onfocus, onblur, onclick, ondblclick, onmousedown, onmouseup, onmouseover, onmousemove, onmouseout, onkeypress, onkeydown, onkeyup (intrinsic events)
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>
Comments
No comments have been made yet.
Please login to leave a comment. Login now