X
HOME HTML5 CSS3 JAVASCRIPT SQL PHP5 JQUERY ANGULAR BOOTSTRAP3 XML MORE...
REFERENCES | EXAMPLES | FORUM | ABOUT

HTML DOM Div Object


Div Object

The Div object represents an HTML <div> element.

Access a Div Object

You can access a <div> element by using getElementById():

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

Create a Div Object

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

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

Div Object Properties

Property Description
align Not supported in HTML5. Use style.textAlign instead.
Sets or returns the value of the align attribute of the <div> element

Standard Properties and Events

The Div object also supports the standard properties and events.


Related Pages

HTML tutorial: HTML Blocks

HTML reference: HTML <div> 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