Flamingo.XPath.html()¶
The html() method is used to display outer HTML content of the node found by XPath as plain text.
Syntax¶
Flamingo.XPath.html(xPath, parent)
Parameters¶
Parameter | Type | Description |
xPath | String | XPath expression. |
parent | Node object | Context node against which specified XPath will be executed. |
Return Value¶
Type | Description |
---|---|
String | Outer HTML of the node found by XPath. |
Example¶
The example below demonstrates how to display HTML code used to define page heading as plain text.
Source HTML code available on original desktop site page:
<html>
<body>
<h1>Hello World!</h1>
</body>
</html>
You need to add the following code to your template to display HTML code used to define page heading as plain text:
<!--{= Flamingo.XPath.html('//h1') }-->
The result will look like:
<h1>Hello World!</h1>
See also