public interface DOMInputElement extends DOMFormControlElement
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getFile()
Returns a string that represents path to a file if the current input type is 'file'.
如果当前输入类型为'file',则返回一个字符串,该字符串表示文件的路径。 |
java.util.List<java.lang.String> |
getFiles()
Returns a list strings that represent path to file if the current input type is 'file' with 'multiple' attribute.
如果当前输入类型是具有'multiple'属性的'file',则返回表示文件路径的列表字符串。 |
boolean |
isCheckbox()
Returns
当输入类型为“复选框”时返回true。 true when the input type is 'checkbox'.
|
boolean |
isChecked()
Returns
当选择类型为“复选框”或“无线电”的输入元素时,返回true。 true when input element with type 'checkbox' or 'radio' is selected.
|
boolean |
isEmailField()
Returns
当输入类型为'email'时返回true。 true when the input type is 'email'.
|
boolean |
isFile()
Returns
当输入类型为“文件”时返回true。 true when the input type is 'file'.
|
boolean |
isMultipleFile()
Returns
当输入类型为具有“多个”属性的“文件”时,返回true。 true when the input type is 'file' with 'multiple' attribute.
|
boolean |
isPasswordField()
Returns
当输入类型为'password'时返回true。 true when the input type is 'password'.
|
boolean |
isRadioButton()
Returns
当输入类型为“ radio”时返回true。 true when the input type is 'radio'.
|
boolean |
isText()
Returns
当isTextField()返回true并且输入类型!='number'时,返回true。 true when
isTextField() returns
true and the input type != 'number'.
|
boolean |
isTextField()
Returns
当输入类型为“文本”,“密码”,“搜索”,“电子邮件”,“ URL”和“数字”时,返回true。 true when the input type is 'text', 'password', 'search', 'email', 'url', and 'number'.
|
void |
setChecked(boolean checked)
Sets a new state of the input control with type 'checkbox' or 'radio'.
使用“复选框”或“无线电”类型设置输入控件的新状态。 |
void |
setFile(java.lang.String... filePath)
Sets one or multiple string values that represent path to a file.
设置一个或多个表示文件路径的字符串值。 |
getForm, getValue, isEnabled, setValue
getAttribute, getAttributes, getBoundingClientRect, getInnerHTML, getInnerText, hasAttribute, removeAttribute, scrollToBottom, scrollToTop, setAttribute, setInnerHTML, setInnerText
appendChild, click, compareDocumentPosition, getChildren, getNextSibling, getNodeName, getNodeType, getNodeValue, getParent, getParentFrameId, getPreviousSibling, getTextContent, getXPath, insertChild, removeChild, replaceChild, setNodeValue, setTextContent
addEventListener, dispatchEvent, getEventListeners, removeEventListener
evaluate, evaluate, findElement, findElements
boolean isText()
true
when
isTextField()
returns
true
and the input type != 'number'.
boolean isCheckbox()
true
when the input type is 'checkbox'.
boolean isRadioButton()
true
when the input type is 'radio'.
boolean isTextField()
true
when the input type is 'text', 'password', 'search', 'email', 'url', and 'number'.
boolean isEmailField()
true
when the input type is 'email'.
boolean isPasswordField()
true
when the input type is 'password'.
boolean isFile()
true
when the input type is 'file'.
boolean isMultipleFile()
true
when the input type is 'file' with 'multiple' attribute.
java.lang.String getFile()
void setFile(java.lang.String... filePath)
filePath
- a string that represent path to a file. Cannot be
null
.
-表示文件路径的字符串。不可能是 。
java.lang.IllegalArgumentException
- when
filePath
is
null
.
java.util.List<java.lang.String> getFiles()
boolean isChecked()
true
when input element with type 'checkbox' or 'radio' is selected. Use this method only with input elements with type 'checkbox' or 'radio'.
true
when input element with type 'checkbox' or 'radio' is selected.
当选择类型为“复选框”或“无线电”的输入元素时。
void setChecked(boolean checked)
checked
- a new state of the input control with type 'checkbox' or 'radio'.
-输入控件的新状态,类型为“复选框”或“无线电”。