RTO_DOM_actions.js

Helper file documentation for RTO_DOM_actions.js.
Docs updated: 2026-03-24

Summary

Button-driven read/write/highlight/close actions.

  • Exports: (none) — auto-binds on DOMContentLoaded
  • Depends on: RTO_form_api.js (and typically RTO_connector.js setting window.RTOconnected)

What it is

A button-driven helper for simple remote DOM workflows: read remote HTML into a local textarea, write it back, highlight a remote element, and close the controlled tab.

Download

Download RTO_DOM_actions.js

Data attributes

  • data-rto-action: read-block | write-block | highlight | close-tab
  • data-rto-tabKey (recommended) — tabKey of the controlled tab
  • data-rto-tabkey (legacy alias) — accepted too
  • data-rto-selector: remote selector (in the controlled tab)
  • data-rto-target: local selector (textarea) for read/write
  • data-rto-color: highlight color (optional)
  • data-rto-ms: highlight duration in ms (optional)
  • data-rto-dirty or data-rto-mark-dirty on a textarea: marks it dirty on input (optional)

Example

<textarea id="localHtml" data-rto-dirty="1" style="width:100%;height:160px"></textarea>

<button data-rto-action="read-block" data-rto-tabKey="app" data-rto-selector="#content" data-rto-target="#localHtml">
  Read remote HTML
</button>

<button data-rto-action="write-block" data-rto-tabKey="app" data-rto-selector="#content" data-rto-target="#localHtml">
  Write remote HTML
</button>

<button data-rto-action="highlight" data-rto-tabKey="app" data-rto-selector="#content" data-rto-color="#ffeb3b" data-rto-ms="1200">
  Highlight
</button>

<button data-rto-action="close-tab" data-rto-tabKey="app">
  Close tab
</button>

<script src="../RTO_helpers/RTO_form_api.js"></script>
<script src="../RTO_helpers/RTO_connector.js"></script>
<script src="../RTO_helpers/RTO_DOM_actions.js"></script>

Next