HTML-DOM - Ausgabeobjekt
Ausgangsobjekt
Das Output-Objekt repräsentiert ein HTML-<output>-Element.
Hinweis: Das Element <output> wird im Internet Explorer / Edge nicht unterstützt.
Greifen Sie auf ein Ausgangsobjekt zu
Sie können auf ein <output>-Element zugreifen, indem Sie getElementById() verwenden:
Beispiel
var x = document.getElementById("myOutput");
Tipp: Sie können auch auf ein <output>-Element zugreifen, indem Sie die Elementsammlung eines Formulars durchsuchen .
Erstellen Sie ein Ausgabeobjekt
Sie können ein <output>-Element erstellen, indem Sie die Methode document.createElement() verwenden:
Beispiel
var x = document.createElement("OUTPUT");
Eigenschaften des Ausgangsobjekts
Property | Description |
---|---|
defaultValue | Sets or returns the default value of an <output> element |
form | Returns a reference to the form that contains the <output> element |
htmlFor | Returns the value of the for attribute of an <output> element |
labels | Returns a list of <label> elements associated with the <output> element |
name | Sets or returns the value of the name attribute of an <output> element |
type | Returns which type of HTML element the Output object represents |
value | Sets or returns the value of an <output> element |
Standardeigenschaften und -ereignisse
Das Output - Objekt unterstützt auch die Standardeigenschaften und - ereignisse .
Verwandte Seiten
HTML-Referenz: HTML-<output>-Tag