form-obfuscator via esm.sh

Import the class and register it manually. See the README for installation and API details.

Use fictional values only. Obfuscation is not encryption: values remain available to scripts and form submission. If JavaScript or the CDN fails, the field stays readable and editable without obfuscation.

Manual registration

The class-only import does not register the element. Focus the field to edit its value, then Tab away to obfuscate it.

import { FormObfuscatorElement } from
  '@aarongustafson/form-obfuscator/form-obfuscator.js';
customElements.define('form-obfuscator', FormObfuscatorElement);

<form-obfuscator>
  <label for="account-number">Account number</label>
  <input id="account-number" name="account"
    value="1234-5678-9012" />
</form-obfuscator>
Focus reveals the value; leaving the field obfuscates it.