Objeto de saída HTML DOM
Objeto de saída
O objeto Output representa um elemento HTML <output>.
Observação: o elemento <output> não é compatível com o Internet Explorer/Edge.
Acessar um objeto de saída
Você pode acessar um elemento <output> usando getElementById():
Exemplo
var x = document.getElementById("myOutput");
Dica: Você também pode acessar um elemento <output> pesquisando na coleção de elementos de um formulário.
Criar um objeto de saída
Você pode criar um elemento <output> usando o método document.createElement():
Exemplo
var x = document.createElement("OUTPUT");
Propriedades do objeto de saída
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 |
Propriedades e eventos padrão
O objeto Output também suporta as propriedades e eventos padrão .
Páginas relacionadas
Referência HTML: tag HTML <output>