Click to Rate and Give Feedback
MSDN
MSDN Library
Web Development
HTML and CSS
Properties
 type Property

  Switch on low bandwidth view
TYPE Attribute | type Property

Gets the classification and default behavior of the button.

Syntax

HTML<ELEMENT TYPE = sType... >
Scripting[ sType = ] object.type

Possible Values

sTypeString that receives one of the following values.
button
Default. Creates a Command button.
reset
Creates a Reset button. If the button is in a form, it resets the fields in the form to their initial values.
submit
Creates a Submit button. If the button is in a form, it submits the form.

The property is read-only. The property has a default value of button.

Remarks

A Submit button has the same default behavior as a button created by using the submit type with the input object. If the ENTER key is pressed while a user is viewing a form that contains a Submit button, the form is submitted. This default behavior of a Submit button is indicated by a border surrounding the button. The border appears when any control in the form receives the focus, other than another button. If the Submit button has a name property, the button contributes a name/value pair to the submitted data.

 New for Windows Internet Explorer 8 Internet Explorer 8 and later. The default value of this attribute depends on the current document compatibility mode. In IE8 mode, the default value is submit. In other compatibility modes and earlier versions of Internet Explorer, the default value is button.

Standards Information

This property is defined in HTML 4.0 World Wide Web link and is defined in World Wide Web Consortium (W3C) Document Object Model (DOM) Level 1 World Wide Web link.

Applies To

BUTTON, HTMLButtonElement Constructor
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
TYPE Attribute Errata      John Sudds   |   Edit   |   Show History

According to the HTML 4.0 recommendation, the default type of button elements is "submit" not "button." To ensure that your button element works as expected in all browsers, always specify the type attribute.

Tags What's this?: dhtml (x) Add a tag
Flag as ContentBug
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker