ElementNode::setInnerHtml

The setInnerHtml() method sets the inner HTML content of the element. It replaces the content of the element with the given HTML string. This method allows for easy manipulation of an element's children by injecting raw HTML string.

Description

public ElementNode::setInnerHtml(string $innerHTML): static

Parameters

innerHTML

The HTML string to set as the inner content of the element.

Return Value

Returns the current instance (static) for method chaining.

Exceptions

None

Source Code
If you find this project useful, consider leaving a on GitHub! Thank you!