Specifies or retrieves the value of the height style property, in pixels.
With the height style property you can set or return the height of an element with a unit designator as a string. The pixelHeight property specifies or retrieves the height as an integer, in pixels. When the value of the pixelHeight property is set, the unit type of the height style property is not changed. The value will be converted to the current unit type of the height style property. If you want to set or retrieve the height as a floating-point number that specifies the value in the current unit type of the height style property, use the posHeight property.
The properties mentioned above can be used to access style settings. If you need the height of a rendered element, you can use the clientHeight, offsetHeight and scrollHeight properties and the getBoundingClientRect method.The currentStyle.pixelHeight property is read-only, all others are read/write.
You can find the related objects in the Supported by objects section below.
Integer that sets or retrieves the height of the object, in pixels.
Default: this property has no default value.
Example HTML code 1:
This example illustrates the use of the pixelHeight property:
Did you find this example helpful?
User Contributed Comments