X
HOME HTML CSS JAVASCRIPT SQL PHP JQUERY ANGULAR BOOTSTRAP XML ASP.NET MORE...
REFERENCES | EXAMPLES | FORUM | ABOUT

HTML DOM Pre Object


Pre Object

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"); Try it

Create a Pre Object

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

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

Pre Object Properties

Property Description
width Not supported in HTML5. Use style.width instead.
Sets or returns the value of the width attribute of the preformatted text

Standard Properties and Events

The Pre object also supports the standard properties and events.


Related Pages

HTML Tutorial: HTML Text Formatting

HTML Reference: HTML <pre> tag



Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]
Search w3schools.com:

WEB HOSTING

UK Reseller Hosting

WEB BUILDING

Download XML Editor FREE Website BUILDER Free HTML5 Templates

SHARE THIS PAGE

facebook