Change the width of an <object> element to 400px:
More "Try it Yourself" examples below.
The width property sets or returns the value of the width attribute of an <object> element.
The width attribute specifies the width of an object.
Tip: Use the height property to set or return the value of the height attribute of an <object> element.
Property | |||||
---|---|---|---|---|---|
width | Yes | Yes | Yes | Yes | Yes |
Return the width property:
Set the width property:
Value | Description |
---|---|
pixels | Specifies the width of the object, in pixels (e.g. height="100") |
Return Value: | A Number, representing the width of the object, in pixels |
---|
Get the width of an <object> element:
The result of x will be:
Change the height and width of an <object> element to 300px:
HTML reference: HTML <object> width attribute