Name

height, width — NN n/a IE 4 DOM n/a

Synopsis

Read/Write

The height and width (and their units) of the element. Because the values are strings containing the assigned units, you cannot use these properties for calculation. See pixelHeight, pixelWidth, posHeight, and posWidth properties. Changes to these properties may not be visible unless the element has its position style attribute set.

Example

document.all.viewArea.style.height = "450px"

Value

String consisting of a numeric value and length measure or percentage.

Default

None.

Get Dynamic HTML: The Definitive Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.