HTML DOM Pre Object

Pre Object

The Pre object represents the HTML <pre> element.

Access Pre Object

You can use getElementById() to access the <pre> element:

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

Try it yourself

Create Pre Object

You can use the document.createElement() method to create a <pre> element:

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

Try it yourself

Pre Object Properties

Properties Description
width

Not supported in HTML5.Please use style.width.

Sets or returns the width attribute value of the preformatted text.

Standard Properties and Events

Pre Object Supports StandardsPropertiesAndEvents.

Related Pages

HTML Tutorial:HTML Text Formatting

HTML Reference Manual:HTML <pre> Tag