HTML tutorial
CSS3 tutorial
Bootstrap tutorial
JavaScript tutorial
JQuery tutorial
AngularJS tutorial
React tutorial
NodeJS tutorial
PHP tutorial
Python tutorial
Python3 tutorial
Django tutorial
Linux tutorial
Docker tutorial
Ruby tutorial
Java tutorial
C tutorial
C ++ tutorial
Perl tutorial
JSP tutorial
Lua tutorial
Scala tutorial
Go tutorial
ASP.NET tutorial
C # tutorial
The Pre object represents an HTML <pre> element
The Pre object represents an HTML <pre> element.
Access a Pre Object
You can access a <pre> element by using getElementById():
var x = document.getElementById("myPre");
Create a Pre Object
You can create a <pre> element by using the document.createElement() method:
var x = document.createElement("PRE");
Property | Description |
---|---|
width | Not supported in HTML5. Use
style.width instead. Sets or returns the value of the width attribute of the preformatted text |
The Pre object also supports the standard properties and events.
HTML Tutorial: HTML Text Formatting
HTML Reference: HTML <pre> tag