Skip to content

Commit

Permalink
New pages: HTMLEmbedElement property and method (#36985)
Browse files Browse the repository at this point in the history
  • Loading branch information
estelle authored Nov 28, 2024
1 parent 14f1c1d commit 64088e3
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 1 deletion.
34 changes: 34 additions & 0 deletions files/en-us/web/api/htmlembedelement/getsvgdocument/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
title: "HTMLEmbedElement: getSVGDocument() method"
short-title: getSVGDocument
slug: Web/API/HTMLEmbedElement/getSVGDocument
page-type: web-api-instance-method
browser-compat: api.HTMLEmbedElement.getSVGDocument
---

{{APIRef("HTML DOM")}}

The **`getSVGDocument()`** method of the {{domxref("HTMLEmbedElement")}} interface returns the {{domxref("Document")}} object of the embedded SVG.

## Value

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

## Examples

```js
const svg = document.getElementById("el").getSVGDocument();
```

## Specifications

{{Specifications}}

## Browser compatibility

{{Compat}}

## See also

- {{domxref("HTMLIFrameElement.getSVGDocument")}}
- {{domxref("HTMLObjectElement.getSVGDocument")}}
5 changes: 4 additions & 1 deletion files/en-us/web/api/htmlembedelement/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ _Inherits properties from its parent, {{domxref("HTMLElement")}}._

## Instance methods

_No specific method; inherits methods from its parent, {{domxref("HTMLElement")}}._
_Also inherits methods from its parent interface, {{domxref("HTMLElement")}}._

- {{domxref("HTMLEmbedElement.getSVGDocument()")}}
- : Returns the embedded SVG as a {{domxref("Document")}}.

## Specifications

Expand Down
37 changes: 37 additions & 0 deletions files/en-us/web/api/htmlembedelement/type/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
title: "HTMLEmbedElement: type property"
short-title: type
slug: Web/API/HTMLEmbedElement/type
page-type: web-api-instance-property
browser-compat: api.HTMLEmbedElement.type
---

{{APIRef("HTML DOM")}}

The **`type`** property of the {{domxref("HTMLEmbedElement")}} interface returns a string that reflects the `type` attribute of the {{HTMLElement("embed")}} element, indicating the {{glossary("MIME type")}} of the resource. It reflects the {{htmlelement("embed")}} element's [`type`](/en-US/docs/Web/HTML/Element/embed#type) attribute

## Value

A string; the MIME type of the resource.

## Examples

```js
const el = document.getElementById("el");
console.log(el.type); // Output: "video/webp"
```

## Specifications

{{Specifications}}

## Browser compatibility

{{Compat}}

## See also

- {{domxref("HTMLObjectElement.type")}}
- {{domxref("HTMLSourceElement.type")}}
- [Media types found on the web](/en-US/docs/Web/Media/Formats)
- [Important MIME types for web developers](/en-US/docs/Web/HTTP/MIME_types#important_mime_types_for_web_developers)

0 comments on commit 64088e3

Please sign in to comment.