public interface ButtonElement extends Element
Button
objects expose the HTMLButtonElement
HTML5 (or HTMLButtonElement
HTML 4) interface, which provides properties and methods (beyond the element object interface they also have available to them by inheritance) for manipulating the layout and presentation of button elements.ALLOW_KEYBOARD_INPUT
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_POSITION_CONTAINED_BY, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_PRECEDING, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE
Modifier and Type | Method and Description |
---|---|
boolean |
checkValidity()
Not supported for button elements.
|
FormElement |
getForm()
The form that this button is associated with.
|
String |
getFormAction()
The URI of a program that processes information submitted by the button.
|
String |
getFormEnctype() |
String |
getFormMethod()
The HTTP method that the browser uses to submit the form.
|
String |
getFormTarget()
A name or keyword indicating where to display the response that is received after submitting the form.
|
NodeList |
getLabels()
A list of
<label>
elements that are labels for this button. |
String |
getName()
The name of the object when submitted with a form.
|
String |
getType()
Indicates the behavior of the button.
|
String |
getValidationMessage()
A localized message that describes the validation constraints that the control does not satisfy (if any).
|
ValidityState |
getValidity()
The validity states that this button is in.
|
String |
getValue()
The current form control value of the button.
|
boolean |
isAutofocus()
The control should have input focus when the page loads, unless the user overrides it, for example by typing in a different control.
|
boolean |
isDisabled()
The control is disabled, meaning that it does not accept any clicks.
|
boolean |
isFormNoValidate()
Indicates that the form is not to be validated when it is submitted.
|
boolean |
isWillValidate()
Indicates whether the button is a candidate for constraint validation.
|
void |
setAutofocus(boolean arg) |
void |
setCustomValidity(String error)
Not supported for button elements.
|
void |
setDisabled(boolean arg) |
void |
setFormAction(String arg) |
void |
setFormEnctype(String arg) |
void |
setFormMethod(String arg) |
void |
setFormNoValidate(boolean arg) |
void |
setFormTarget(String arg) |
void |
setName(String arg) |
void |
setValue(String arg) |
blur, click, focus, getAccessKey, getAttribute, getAttributeNode, getAttributeNodeNS, getAttributeNS, getBoundingClientRect, getChildElementCount, getChildren, getClassList, getClassName, getClientHeight, getClientLeft, getClientRects, getClientTop, getClientWidth, getContentEditable, getDataset, getDir, getElementsByClassName, getElementsByTagName, getElementsByTagNameNS, getFirstElementChild, getId, getInnerHTML, getInnerText, getLang, getLastElementChild, getNextElementSibling, getOffsetHeight, getOffsetLeft, getOffsetParent, getOffsetTop, getOffsetWidth, getOnabort, getOnbeforecopy, getOnbeforecut, getOnbeforepaste, getOnblur, getOnchange, getOnclick, getOncontextmenu, getOncopy, getOncut, getOndblclick, getOndrag, getOndragend, getOndragenter, getOndragleave, getOndragover, getOndragstart, getOndrop, getOnerror, getOnfocus, getOninput, getOninvalid, getOnkeydown, getOnkeypress, getOnkeyup, getOnload, getOnmousedown, getOnmousemove, getOnmouseout, getOnmouseover, getOnmouseup, getOnmousewheel, getOnpaste, getOnreset, getOnscroll, getOnsearch, getOnselect, getOnselectstart, getOnsubmit, getOntouchcancel, getOntouchend, getOntouchmove, getOntouchstart, getOnwebkitfullscreenchange, getOnwebkitfullscreenerror, getOuterHTML, getOuterText, getPreviousElementSibling, getScrollHeight, getScrollLeft, getScrollTop, getScrollWidth, getStyle, getTabIndex, getTagName, getTitle, getWebkitdropzone, getWebkitRegionOverflow, hasAttribute, hasAttributeNS, insertAdjacentElement, insertAdjacentHTML, insertAdjacentText, isContentEditable, isDraggable, isHidden, isSpellcheck, isTranslate, querySelector, querySelectorAll, removeAttribute, removeAttributeNode, removeAttributeNS, scrollByLines, scrollByPages, scrollIntoView, scrollIntoView, scrollIntoViewIfNeeded, scrollIntoViewIfNeeded, setAccessKey, setAttribute, setAttributeNode, setAttributeNodeNS, setAttributeNS, setClassName, setContentEditable, setDir, setDraggable, setHidden, setId, setInnerHTML, setInnerText, setLang, setOnabort, setOnbeforecopy, setOnbeforecut, setOnbeforepaste, setOnblur, setOnchange, setOnclick, setOncontextmenu, setOncopy, setOncut, setOndblclick, setOndrag, setOndragend, setOndragenter, setOndragleave, setOndragover, setOndragstart, setOndrop, setOnerror, setOnfocus, setOninput, setOninvalid, setOnkeydown, setOnkeypress, setOnkeyup, setOnload, setOnmousedown, setOnmousemove, setOnmouseout, setOnmouseover, setOnmouseup, setOnmousewheel, setOnpaste, setOnreset, setOnscroll, setOnsearch, setOnselect, setOnselectstart, setOnsubmit, setOntouchcancel, setOntouchend, setOntouchmove, setOntouchstart, setOnwebkitfullscreenchange, setOnwebkitfullscreenerror, setOuterHTML, setOuterText, setScrollLeft, setScrollTop, setSpellcheck, setTabIndex, setTitle, setTranslate, setWebkitdropzone, webkitMatchesSelector, webkitRequestFullscreen, webkitRequestFullScreen
addEventListener, addEventListener, appendChild, cloneNode, compareDocumentPosition, contains, dispatchEvent, getAttributes, getBaseURI, getChildNodes, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentElement, getParentNode, getPrefix, getPreviousSibling, getTextContent, hasAttributes, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, removeEventListener, removeEventListener, replaceChild, setNodeValue, setPrefix, setTextContent
boolean isAutofocus()
void setAutofocus(boolean arg)
boolean isDisabled()
void setDisabled(boolean arg)
FormElement getForm()
The form that this button is associated with. If the button is a descendant of a form element, then this attribute is the ID of that form element.
If the button is not a descendant of a form element, then:
String getFormAction()
void setFormAction(String arg)
String getFormEnctype()
void setFormEnctype(String arg)
String getFormMethod()
void setFormMethod(String arg)
boolean isFormNoValidate()
void setFormNoValidate(boolean arg)
String getFormTarget()
void setFormTarget(String arg)
String getName()
void setName(String arg)
String getType()
Indicates the behavior of the button. This is an enumerated attribute with the following possible values:
submit
: The button submits the form. This is the default value if the attribute is not specified,
HTML5 or if it is dynamically changed to an empty or invalid value.reset
: The button resets the form.button
: The button does nothing.String getValidationMessage()
ValidityState getValidity()
String getValue()
void setValue(String arg)
boolean isWillValidate()
boolean checkValidity()
void setCustomValidity(String error)
Copyright © 2016. All rights reserved.