nameInput) and target display (mirrorText) elements in Webflow. <script> tag that listens for input events and updates mirrorText.textContent with nameInput.value. To mirror user input from a Webflow form field to a non-form text element in real time, you'll use a small JavaScript snippet that listens for input events and updates the target element accordingly.
id="nameInput".<div> block) and give it an id="mirrorText".
<script> tags, paste the following JavaScript:
<script>
document.addEventListener("DOMContentLoaded", function () {
const inputField = document.getElementById("nameInput");
const mirrorText = document.getElementById("mirrorText");
if (inputField && mirrorText) {
inputField.addEventListener("input", function () {
mirrorText.textContent = inputField.value;
});
}
});
</script>
```javascript
mirrorText.textContent = inputField.value || "Your mirrored text here";
```
.value with string methods as needed: mirrorText.textContent = inputField.value.toUpperCase();
To mirror input in real time on a Webflow page, assign unique IDs to your input and target elements, and use JavaScript to listen for .addEventListener("input", …) events, updating the display using textContent.