Obiekt wyjściowy HTML DOM
Obiekt wyjściowy
Obiekt Output reprezentuje element HTML <output>.
Uwaga: Element <output> nie jest obsługiwany w przeglądarce Internet Explorer / Edge.
Uzyskaj dostęp do obiektu wyjściowego
Możesz uzyskać dostęp do elementu <output> za pomocą getElementById():
Przykład
var x = document.getElementById("myOutput");
Wskazówka: możesz również uzyskać dostęp do elementu <output>, przeszukując kolekcję elementów formularza.
Utwórz obiekt wyjściowy
Możesz utworzyć element <output> za pomocą metody document.createElement():
Przykład
var x = document.createElement("OUTPUT");
Właściwości obiektu wyjściowego
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 |
Standardowe właściwości i zdarzenia
Obiekt Output obsługuje również standardowe właściwości i zdarzenia .
Powiązane strony
Odniesienie HTML: HTML <output> tag