HTML DOM Div object

Div object

Div object represents the HTML <div> element.

Access Div object

U kunt getElementById() gebruiken om toegang te krijgen tot het <div>-element:

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

Try it yourself

Create Div object

U kunt de methode document.createElement() gebruiken om een <div>-element te maken:

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

Try it yourself

Div object properties

properties Description
align

Not supported in HTML5.Please use style.textAlign.

Set or return the align attribute value of the <div> element.

Standard properties and events

Div object supports standardspropertiesandEvents.

Related pages

HTML tutorial:HTML block

HTML reference manual:HTML <div> tag