x property (img)
Returns the left position of an image relative to the left side of its offsetParent element, in pixels.
For a cross-browser solution, use the offsetLeft property instead.
You can find the related objects in the Supported by objects section below.
This property is read-only.
Integer that returns the left position, in pixels.
Default: this property has no default value.
Example HTML code 1:
This example illustrates the use of the x property:
Did you find this example helpful?
User Contributed Comments