Pre oggetto HTML DOM
Pre oggetto
L'oggetto Pre rappresenta un elemento HTML <pre>.
Accedi a un pre oggetto
Puoi accedere a un elemento <pre> usando getElementById():
Esempio
var x = document.getElementById("myPre");
Crea un pre oggetto
Puoi creare un elemento <pre> usando il metodo document.createElement():
Esempio
var x = document.createElement("PRE");
Proprietà pre oggetto
Property | Description |
---|---|
width | Not supported in HTML5. Use
style.width instead. Sets or returns the value of the width attribute of the preformatted text |
Proprietà ed eventi standard
L'oggetto Pre supporta anche le proprietà e gli eventi standard .
Pagine correlate
Esercitazione HTML: formattazione del testo HTML
Riferimento HTML: tag HTML <pre>