---
title: HTMLObjectElement.width
slug: Web/API/HTMLObjectElement/width
tags:
  - API
  - HTML DOM
  - HTMLObjectElement
  - NeedsExample
  - Property
  - Reference
  - width
browser-compat: api.HTMLObjectElement.width
---
{{APIRef("HTML DOM")}}

The **`width`** property of the
{{domxref("HTMLObjectElement")}} interface returns a {{domxref("DOMString")}} that
reflects the {{htmlattrxref("width", "object")}} HTML attribute, specifying the
displayed width of the resource in CSS pixels.

## Syntax

```js
var String = HTMLObjectElement.width;
HTMLObjectElement.width = String;
```

### Value

A {{domxref("DOMString")}}.

## Specifications

{{Specifications}}

## Browser compatibility

{{Compat}}
