Please drop the `<script>` tag and use this snippet instead:
```html
  <p dir="ltr">
    <label>
      <input type="checkbox"
        onchange="document.documentElement.dir = this.checked ? 'rtl' : 'ltr';">
      RTL mode
    </label>
  </p>
```

Nit: always indent with two spaces — no tabs.