MDN self-hosted library · e01.org

HTMLEmbedElement: width property

HTML DOM

Open notebook · 2 cells web-api-instance-property upstream source

HTML DOM

The width property of the HTMLEmbedElement interface returns a string that reflects the width attribute of the embed element, indicating the displayed width of the resource in CSS pixels.

Value

A string indicating the displayed width of the resource in CSS pixels.

Examples

<embed id="el" width="800" height="600" src="https://example.com" />
const el = document.getElementById("el");
console.log(el.width); // Output: '800'

Specifications

Browser compatibility

See also

  • HTMLCanvasElement.width
  • HTMLIFrameElement.width
  • HTMLImageElement.width
  • HTMLObjectElement.width
  • HTMLSourceElement.width
  • HTMLVideoElement.width