HTML-DOM - Eingabe-Submit -Objekt
Eingabe-Submit-Objekt
Das Input Submit-Objekt repräsentiert ein HTML-<input>-Element mit type="submit".
Greifen Sie auf ein Input Submit-Objekt zu
Sie können auf ein <input>-Element mit type="submit" zugreifen, indem Sie getElementById() verwenden:
Beispiel
var x = document.getElementById("mySubmit");
Tipp: Sie können auch auf <input type="submit"> zugreifen, indem Sie die Elementsammlung eines Formulars durchsuchen .
Erstellen Sie ein Input Submit-Objekt
Sie können ein <input>-Element mit type="submit" erstellen, indem Sie die Methode document.createElement() verwenden:
Beispiel
var x = document.createElement("INPUT");
x.setAttribute("type", "submit");
Geben Sie die Objekteigenschaften ein
Property | Description |
---|---|
autofocus | Sets or returns whether a submit button should automatically get focus when the page loads |
defaultValue | Sets or returns the default value of a submit button |
disabled | Sets or returns whether the submit button is disabled, or not |
form | Returns a reference to the form that contains the submit button |
formAction | Sets or returns the value of the formaction attribute of a submit button |
formEnctype | Sets or returns the value of the formenctype attribute of a submit button |
formMethod | Sets or returns the value of the formmethod attribute of a submit button |
formNoValidate | Sets or returns whether the form-data should be validated or not, on submission |
formTarget | Sets or returns the value of the formtarget attribute of a submit button |
name | Sets or returns the value of the name attribute of a submit button |
type | Returns which type of form element the submit button is |
value | Sets or returns the value of the value attribute of the submit button |
Standardeigenschaften und -ereignisse
Das Input Submit - Objekt unterstützt auch die Standardeigenschaften und - ereignisse .
Verwandte Seiten
HTML-Tutorial: HTML-Formulare
HTML-Referenz: HTML-<input>-Tag
HTML-Referenz: HTML-Attribut vom Typ <input>