-
Notifications
You must be signed in to change notification settings - Fork 22.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e04783b
commit c2bc434
Showing
2 changed files
with
99 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
--- | ||
title: "Element: getHTML() method" | ||
short-title: getHTML() | ||
slug: Web/API/Element/getHTML | ||
page-type: web-api-instance-method | ||
browser-compat: api.Element.getHTML | ||
--- | ||
|
||
{{APIRef("DOM")}}{{SeeCompatTable}}{{SecureContext_Header}} | ||
|
||
The **`getHTML()`** method of the {{domxref("Element")}} interface is used to serialize an Element's DOM to an HTML string. | ||
|
||
## Syntax | ||
|
||
```js-nolint | ||
const html = element.getHTML(options) | ||
``` | ||
|
||
### Parameters | ||
|
||
- `options` {{optional_inline}} | ||
|
||
- : An options object with the following optional parameters: | ||
|
||
- `serializableShadowRoots` | ||
- : A boolean value that specifies whether to include serializable shadow roots. The default value is `false`. | ||
- `shadowRoots` | ||
- : An array of {{domxref("ShadowRoot")}} objects to serialize, these are included regardless of whether they | ||
are marked as serializable. The default value is an empty array. | ||
|
||
### Return value | ||
|
||
A string that represents the HTML serialization of the Element. | ||
|
||
### Exceptions | ||
|
||
None. | ||
|
||
## Specifications | ||
|
||
{{Specifications}} | ||
|
||
## Browser compatibility | ||
|
||
{{Compat}} | ||
|
||
## See Also | ||
|
||
- {{domxref("ShadowRoot.getHTML()")}} | ||
- {{domxref("Element.innerHTML")}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
--- | ||
title: "ShadowRoot: getHTML() method" | ||
short-title: getHTML() | ||
slug: Web/API/ShadowRoot/getHTML | ||
page-type: web-api-instance-method | ||
browser-compat: api.ShadowRoot.getHTML | ||
--- | ||
|
||
{{APIRef("DOM")}}{{SeeCompatTable}}{{SecureContext_Header}} | ||
|
||
The **`getHTML()`** method of the {{domxref("ShadowRoot")}} interface is used to serialize a ShadowRoot's DOM to an HTML string. | ||
|
||
## Syntax | ||
|
||
```js-nolint | ||
const html = shadowRoot.getHTML(options) | ||
``` | ||
|
||
### Parameters | ||
|
||
- `options` {{optional_inline}} | ||
|
||
- : An options object with the following optional parameters: | ||
|
||
- `serializableShadowRoots` | ||
- : A boolean value that specifies whether to include serializable shadow roots. The default value is `false`. | ||
- `shadowRoots` | ||
- : An array of {{domxref("ShadowRoot")}} objects to serialize, these are included regardless of whether they | ||
are marked as serializable. The default value is an empty array. | ||
|
||
### Return value | ||
|
||
A string that represents the HTML serialization of the ShadowRoot. | ||
|
||
### Exceptions | ||
|
||
None. | ||
|
||
## Specifications | ||
|
||
{{Specifications}} | ||
|
||
## Browser compatibility | ||
|
||
{{Compat}} | ||
|
||
## See Also | ||
|
||
- {{domxref("ShadowRoot.innerHTML")}} |