HTML-DOM-Eingang Bild-Objekt
Eingang Bild-Objekt
Eingabebildobjekt Darstellungsart mit = "image" HTML-Element <input> -Elemente.
Eingang Bild Object Access
Sie können getElementById () Funktion verwenden, um Zugriff type = "image" mit <input> -Element-Attribute:
var x = document.getElementById("myImage");
Tipp: Sie können auch bilden Elemente des Eingangs für Datum und Uhrzeit Sammlung von Objekten zuzugreifen.
Erstellen Eingangsbildobjekt
Sie können document.createElement () -Methode das type = "image" Attribut des <input> -Element zu erstellen verwenden mit:
var x = document.createElement("INPUT");
x.setAttribute("type", "image");
x.setAttribute("type", "image");
Eingang Bildobjekteigenschaften
= HTML5 neue Eigenschaft.
Property | 描述 |
---|---|
alt | 设置或返回 input image 的 alt 属性值 |
autofocus | 设置或返回 input image 是否在页面加载后自动获取焦点 |
defaultValue | 设置或返回 input image 默认值 |
disabled | 设置或返回 input image 是否被禁用 |
form | 返回包含 input image 的表单引用 |
formAction | 设置或返回 input image 的 formaction 属性值 |
formEnctype | 设置或返回 input image 的 formenctype 属性值 |
formMethod | 设置或返回 input image 的 formmethod 属性值 |
formNoValidate | 设置或返回 form-data 在提交时是否应该验证 |
formTarget | 设置或返回 input image 的 formtarget 属性值 |
height | 设置或返回 input image 的 height 属性值 |
name | 设置或返回 input image 的 name 属性值 |
src | 设置或返回 input image 的 src 属性值 |
type | 返回 input image 的表单元素类型 |
value | 设置或返回 input image 的 value 属性值 |
width | 设置或返回 input image 的 width 属性值 |
Standard-Eigenschaften und Ereignisse
Eingang Datetime - Objekt unterstützt auch Standard - Attribute und Ereignisse .
In Verbindung stehende Artikel
HTML - Tutorial: HTML - Formulare
HTML - Referenzhandbuch: HTML <INPUT> -Tag
HTML - Referenzhandbuch: HTML <INPUT> der type - Attribut