Page HTML
The PageHTML plugin allows you to add custom HTML content to every survey page, whereas the HTML element adds HTML to a single page. This can be useful for adding instructions, images, or any other HTML elements to enhance the survey experience.
Basic Usage
Parameters
The HTML content to be added to the survey page.
The ID of the element where the content should be inserted.
The position where the content should be inserted. Can be ‘top’ or ‘bottom’.
Custom styles to apply to the content container.
Methods
The PageHTML plugin inherits methods from the base Plugin class and implements some specific methods:
Returns the HTML content to be inserted into the page.
Updates the HTML content of the plugin.
Parameters:
newContent
(string): The new HTML content
Lifecycle Hooks
The PageHTML plugin uses the following lifecycle hooks:
Set up the HTML content in the DOM when the plugin is initialized.
This method is called before each page is rendered, but currently doesn’t perform any actions.
This method is called after each page is rendered, but currently doesn’t perform any actions.
This method is called before the survey finishes, but currently doesn’t perform any actions.
Example
Here’s an example of how to create a PageHTML plugin with custom styling: