HTML DOM Pre Object

Pre Object

The Pre object speaks to a HTML <pre> element.

Access a Pre Object

You can get to a <pre> component by utilizing getElementById():

var x = document.getElementById("myPre"); Try it

Create a Pre Object

You can make a <pre> component by utilizing the document.createElement() method:

var x = document.createElement("PRE"); Try it

Pre Object Properties

Property Description
width Not bolstered in HTML5. Use style.width instead.
Sets or returns the estimation of the width quality of the preformatted text

Standard Properties and Events

The Pre object additionally bolsters the standard properties and events.

Related Pages

HTML Tutorial: HTML Text Formatting

HTML Reference: HTML <pre> tag