Объект вывода HTML DOM
Выходной объект
Объект Output представляет HTML-элемент <output>.
Примечание. Элемент <output> не поддерживается в Internet Explorer/Edge.
Доступ к выходному объекту
Вы можете получить доступ к элементу <output> с помощью getElementById():
Пример
var x = document.getElementById("myOutput");
Совет: Вы также можете получить доступ к элементу <output>, выполнив поиск в коллекции элементов формы.
Создайте объект вывода
Вы можете создать элемент <output> с помощью метода document.createElement():
Пример
var x = document.createElement("OUTPUT");
Свойства выходного объекта
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 |
Стандартные свойства и события
Объект Output также поддерживает стандартные свойства и события .
Связанные страницы
Справочник по HTML: HTML-тег <output>