HTML DOM Pre Object
<!--
main_leaderboard, all: [728,90][970,90][320,50][468,60]-->
HTML DOM Pre Object
❮ Previous
Next ❯
Pre Object
The Pre object represents an HTML <pre> element.
Access a Pre Object
You can access a <pre> element by using getElementById():
Example
var x = document.getElementById("myPre");Try it Yourself »
Create a Pre Object
You can create a <pre> element by using the document.createElement() method:
Example
var x = document.createElement("PRE");
Try it Yourself »
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
❮ Previous
Next ❯