Input Mirroring

Mirror input values to other elements in real-time
Learn how to capture input events and update the DOM as users type. Perfect for live previews, character counters, and interactive forms!
on input value my possessive

Demo 1: Basic Text Mirroring

Your name will appear here...

Demo 2: Large Display

HEADLINE GOES HERE

Demo 3: Code Preview

< CODE >

Demo 4: Character Counter

Your bio will appear here...
Characters: 0

The Code

Basic Input Mirroring:

<input _="on input put my value into #mirror" /> <div id="mirror"></div>

Character Counter:

<textarea _="on input put my value into #mirror then put my value's length into #count"> </textarea> <div id="mirror"></div> <span id="count"></span>

How it works:

Key Concepts:

Input Events:

Common Use Cases:

Advanced Patterns:

<!-- Uppercase transformation --> <input _="on input put my value.toUpperCase() into #output" /> <!-- Word count --> <textarea _="on input put my value.split(' ').length into #word-count"> </textarea> <!-- Conditional display --> <input _="on input if my value's length > 5 put 'Long enough!' into #status else put 'Too short' into #status end" />

Try it yourself: