Oggetto di output HTML DOM
Oggetto di output
L'oggetto Output rappresenta un elemento HTML <output>.
Nota: l'elemento <output> non è supportato in Internet Explorer/Edge.
Accedi a un oggetto di output
Puoi accedere a un elemento <output> usando getElementById():
Esempio
var x = document.getElementById("myOutput");
Suggerimento: puoi anche accedere a un elemento <output> cercando nella raccolta di elementi di un modulo.
Crea un oggetto di output
È possibile creare un elemento <output> utilizzando il metodo document.createElement():
Esempio
var x = document.createElement("OUTPUT");
Proprietà dell'oggetto di 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 |
Proprietà ed eventi standard
L'oggetto Output supporta anche le proprietà e gli eventi standard .
Pagine correlate
Riferimento HTML: tag HTML <output>