Overview
Some websites generate elements dynamically after the page has loaded.
In these cases, accessibility fixes such as changing h2
to h1
or converting a div
to a p
must happen dynamically as well.
With Pluro, you can add custom JavaScript or CSS directly inside your domain configuration:
π Path:MyPluro β [Your Domain] β Settings β Function Configuration β Advanced Code
There you can insert either CSS or JavaScript code.
Step 1 β Define Conversion Rules
Use the convertElements
array to configure which tags should be replaced.
Step 2 β Add the Observer
The observer listens to a container on your page (e.g., #header_group1
) and converts matching elements as soon as they are created.
Step 3 β Choose the Correct Container
-
#header_group1
in the example is the wrapper element (container) being observed. -
You must replace it with the container where your dynamic elements are actually created.
How to find it:
-
Open your site β Right-click β Inspect (DevTools).
-
Select the dynamic element.
-
Move up the DOM tree until you find a stable wrapper (
div
,section
, etc.) with a unique ID or class. -
Use that selector instead of
#header_group1
.
Step 4 β Save in MyPluro
-
Go to:
MyPluro β [Your Domain] β Settings β Function Configuration β Advanced Code
-
Switch to the JavaScript tab.
-
Paste the full code.
-
Save your configuration.
The script will now run automatically on your site through the Pluro system.
Step 5 β Test
-
Reload your site.
-
Open DevTools and confirm the tags are being converted (
h2 β h1
,div β p
, etc.). -
Check attributes are preserved.
-
Confirm
tabindex="0"
is added when missing. -
Test keyboard navigation (TAB) to ensure accessibility is improved.
Notes
-
Always scope your selectors to avoid global replacements.
-
Changing tags may affect CSS or JS tied to the original element β test carefully.
-
Respect heading hierarchy (only one
h1
per page). -
No
<script>
tag is needed β this runs as part of Pluroβs injected accessibility system.
β‘ Summary:
To apply custom tag conversions dynamically:
-
Define your rules in
convertElements
. -
Set the correct container in
_uniToolbarObserver
. -
Paste the script under MyPluro β Domain β Settings β Function Configuration β Advanced Code β JavaScript.
-
Save and test.