HTML Document wrapper.
npm install @jtorm/document-model
Select an element by CSS selector.
Option | Type | Description |
---|---|---|
selector |
string |
CSS selector |
Select all elements by CSS selector.
Option | Type | Description |
---|---|---|
selector |
string |
CSS selector |
Select an element with the select method, and if element exists, process the callback.
Option | Type | Description |
---|---|---|
selector |
string |
CSS selector |
fn |
function |
Callback function with the element as a parameter |
Get the head inner HTML of the document.
Get the body inner HTML of the document.
Get the complete HTML of the document.